From 4eb76326828ae5a8e6fd1f61ad5cdc1d1a4e8b20 Mon Sep 17 00:00:00 2001 From: Anna Wiggins Date: Wed, 11 Dec 2019 13:30:18 -0500 Subject: [PATCH] Only render 7x7 instead of 8x8, so that we can center the player on the screen more easily. --- player.lua | 2 +- world.lua | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/player.lua b/player.lua index 397d008..114b4c3 100644 --- a/player.lua +++ b/player.lua @@ -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 diff --git a/world.lua b/world.lua index 7d4ff42..9094bb3 100644 --- a/world.lua +++ b/world.lua @@ -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