some upgrades

This commit is contained in:
2022-03-02 20:31:33 +01:00
parent f71db7a456
commit 022858330a
30 changed files with 45 additions and 33 deletions

View File

@@ -1,7 +1,8 @@
local game = {}
local function updateinit(gamex)
local camera = {}
local function updateinit(gamex, camerax)
game = gamex
camera = camerax
end
local function update(dt)
@@ -48,8 +49,13 @@ local function update(dt)
--revive player
player.spritesheets["player_die"]:setFrame(1)
player:revive(dt)
end
if key("x") then
print("x: \""..player.x.."\"; y: \""..player.y.."\"")
end
end
local dx,dy = (player.x - camera.x) / 2, (player.y - camera.y) / 2
camera:move(dx, dy)
end
return {
update = update,