remapped debug controls and made them changeable

This commit is contained in:
bizcochito
2022-01-19 13:28:09 +01:00
parent a183dac913
commit 9c89a970ed
2 changed files with 49 additions and 42 deletions

View File

@@ -65,6 +65,46 @@ function love.update(dt)
current_dt = dt
--keypressed
if Keybind:Check(Keybind.menu.pause) then
if do_pause then
do_pause = false
else
pausepage = 1
do_pause = true
end
end
if Keybind:Check(Keybind.debug.debug) then
if debug then
debug = false
debug_collision = true
elseif debug_collision then
debug_collision = false
else
debug = true
end
end
if Keybind:Check(Keybind.debug.reposition) then
if not editor_mode then
main_Player.pos.x, main_Player.pos.y = 16,-10
end
end
if Keybind:Check(Keybind.debug.reload) then
LoadLevel()
end
if Keybind:Check(Keybind.debug.editor) then
if editor_mode then
editor_mode = false
else
editor_mode = true
end
end
--editor
if editor_mode then
stepEditor()
else
@@ -84,48 +124,6 @@ function love.wheelmoved(_, y)
end
end
function love.keypressed(key)
if key == "escape" then
if do_pause then
do_pause = false
else
pausepage = 1
do_pause = true
end
end
if key == "f1" then
if debug then
debug = false
debug_collision = true
elseif debug_collision then
debug_collision = false
else
debug = true
end
end
if key == "f2" then
if editor_mode then
else
main_Player.pos.x, main_Player.pos.y = 16,-10
end
end
if key == "f3" then
LoadLevel()
end
if key == "f4" then
if editor_mode then
editor_mode = false
else
editor_mode = true
end
end
end
function love.draw()
if game.width ~= love.graphics.getWidth() or game.height ~= love.graphics.getHeight() then
game.width = love.graphics.getWidth()