main menu
This commit is contained in:
parent
538fea556d
commit
2b7ef7c276
2 changed files with 54 additions and 39 deletions
23
main.lua
23
main.lua
|
@ -3,9 +3,28 @@ function love.load()
|
|||
end
|
||||
|
||||
function love.update(dt)
|
||||
scenes[#scenes].update(dt)
|
||||
if #scenes == 0 then
|
||||
love.event.quit()
|
||||
end
|
||||
if scenes[#scenes].update then
|
||||
scene_ended = scenes[#scenes].update(key)
|
||||
end
|
||||
end
|
||||
|
||||
function love.keypressed(key)
|
||||
if scenes[#scenes].keypressed then
|
||||
scenes[#scenes].keypressed(key)
|
||||
end
|
||||
end
|
||||
|
||||
function love.keyreleased(key)
|
||||
if scenes[#scenes].keyreleased then
|
||||
scenes[#scenes].keyreleased(key)
|
||||
end
|
||||
end
|
||||
|
||||
function love.draw()
|
||||
scenes[#scenes].draw()
|
||||
if scenes[#scenes].draw then
|
||||
scenes[#scenes].draw()
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue