Escape leaves game/exits

This commit is contained in:
Erkki Seppälä 2014-10-22 21:44:51 +03:00
parent 3d2ddcbd62
commit a4b6e7450f
2 changed files with 4 additions and 0 deletions

View file

@ -171,6 +171,8 @@ function level_state:keypressed(key, unicode)
or love.keyboard.isDown("rctrl")) then
current_level.reset = true
elseif key == "escape" then
Gamestate.switch(menu_state)
elseif key == "d"
and (love.keyboard.isDown("lctrl")
or love.keyboard.isDown("rctrl")) then

View file

@ -62,6 +62,8 @@ function menu_state:keypressed(key, unicode)
elseif key == "c" then
level_state.mode = "computer"
Gamestate.switch(level_state)
elseif key == "escape" then
love.event.quit()
else
level_state.computer = "2player"
Gamestate.switch(level_state)