Only render 7x7 instead of 8x8, so that we can center the player on the screen more easily.
This commit is contained in:
parent
aa22c8a054
commit
4eb7632682
|
@ -82,7 +82,7 @@ function handle_input()
|
||||||
end
|
end
|
||||||
|
|
||||||
function draw_player()
|
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
|
-- todo: animate the character on move
|
||||||
|
|
||||||
-- draw the player's HUD
|
-- draw the player's HUD
|
||||||
|
|
12
world.lua
12
world.lua
|
@ -141,16 +141,16 @@ end
|
||||||
-- this calculates everything about the world fresh every frame,
|
-- this calculates everything about the world fresh every frame,
|
||||||
-- but pico-8 handles this just fine!
|
-- but pico-8 handles this just fine!
|
||||||
function draw_world(start_x, start_y)
|
function draw_world(start_x, start_y)
|
||||||
for x=0,7 do
|
for x=0,6 do
|
||||||
for y=0,7 do
|
for y=0,6 do
|
||||||
-- color the background for this segment
|
-- color the background for this segment
|
||||||
rectfill(x*16, y*16, x*16+16, y*16+16,
|
rectfill(x*16+8, y*16+8, x*16+24, y*16+24,
|
||||||
get_base_color(start_x-4+x, start_y-4+y))
|
get_base_color(start_x-3+x, start_y-3+y))
|
||||||
|
|
||||||
-- now get the sprite, and render as long as it isn't 0
|
-- 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
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user