From de94226e1b302cee2a006f78f0153aa5fa081f47 Mon Sep 17 00:00:00 2001 From: cursed22bc Date: Sun, 1 Mar 2026 12:30:05 +0200 Subject: player and animation --- main.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'main.lua') diff --git a/main.lua b/main.lua index 3f25812..5a4e2f0 100644 --- a/main.lua +++ b/main.lua @@ -1,5 +1,7 @@ local VIRTUAL_WIDTH, VIRTUAL_HEIGHT = 16*10*3, 9*10*3 local CANVAS_PADDING = 6 + +DEBUG = true local CANVAS_WIDTH = VIRTUAL_WIDTH + CANVAS_PADDING local CANVAS_HEIGHT = VIRTUAL_HEIGHT + CANVAS_PADDING local WORLD_TO_CANVAS = 3 @@ -114,6 +116,10 @@ function love.keypressed(key, scancode, isrepeat) if key == "f11" then love.window.setFullscreen(not love.window.getFullscreen(), "desktop") end + if (key == "space" or key == "up" or key == "w") and not isrepeat then + local player = world and world:getPlayer() + if player then player:jump() end + end end function love.draw() -- cgit v1.2.3