Only render 7x7 instead of 8x8, so that we can center the player on the screen more easily.

This commit is contained in:
Anna Rose 2019-12-11 13:30:18 -05:00
parent aa22c8a054
commit 4eb7632682
2 changed files with 7 additions and 7 deletions

View File

@ -82,7 +82,7 @@ function handle_input()
end
function draw_player()
spr(player_lookup[facing_v][facing_h], 64, 64)
spr(player_lookup[facing_v][facing_h], 60, 60)
-- todo: animate the character on move
-- draw the player's HUD

View File

@ -141,16 +141,16 @@ end
-- this calculates everything about the world fresh every frame,
-- but pico-8 handles this just fine!
function draw_world(start_x, start_y)
for x=0,7 do
for y=0,7 do
for x=0,6 do
for y=0,6 do
-- color the background for this segment
rectfill(x*16, y*16, x*16+16, y*16+16,
get_base_color(start_x-4+x, start_y-4+y))
rectfill(x*16+8, y*16+8, x*16+24, y*16+24,
get_base_color(start_x-3+x, start_y-3+y))
-- now get the sprite, and render as long as it isn't 0
local sprite = get_tile(start_x-4+x, start_y-4+y)
local sprite = get_tile(start_x-3+x, start_y-3+y)
if sprite ~= 0 then
spr(sprite, x*16, y*16, 2, 2)
spr(sprite, x*16+8, y*16+8, 2, 2)
end
end
end