Browse Source

enter/exit options room

master
Alexander Yakovlev 5 years ago
parent
commit
fd817756f3
  1. 10
      src/init.coffee

10
src/init.coffee

@ -31,6 +31,15 @@ selectOption = (event, button) ->
return
$(".options li.active").click()
# enter the options room
enterOptions = (event, button) ->
if button != "back" and button != "start"
return
if button == "start"
return salet.goTo(salet.optionsRoom)
if button == "back" and salet.currentRoom == salet.optionsRoom
return salet.goBack()
# Joystick check, fires events
joystick = () ->
if typeof navigator.getGamepads == "function"
@ -59,3 +68,4 @@ window.selectedoption ?= 1
$(document).on("press", selectUp)
$(document).on("press", selectDown)
$(document).on("press", selectOption)
$(document).on("press", enterOptions)

Loading…
Cancel
Save