         @view.processResult(result)
       @showView()
 
-  swapView: (result) =>
+  swapView: (result) ->
     @view = view
     if (result != null)
       @view.processResult(result)
     @showView()
 
-  popToTopView: (result) =>
+  popToTopView: (result) ->
     if (@stack.length > 0)
       @view = @stack.shift()
       while (@stack.length > 0)

    @setView(mapView)


  start: =>
    @screenCanvas = document.getElementById("screenID");
    ctx = @screenCanvas.getContext("2d")
    ctx.webkitImageSmoothingEnabled = false

    event.stopImmediatePropagation()
    return false

  getSoundSetting : ->
    Device.getSetting("sound", true)

  setSoundSetting : (value) ->
    Device.setSetting("sound", value)

  getMusicSetting : ->
    Device.getSetting("music", true)

  setMusicSetting : (value) ->
    Device.setSetting("music", value)
    if (value)
      @resumeMusic()
    else
      @stopMusic()

  getCombatMusicSetting : ->
    Device.getSetting("combatMusic", true)

  setCombatMusicSetting : (value) ->
    Device.setSetting("combatMusic", value)

  getFastSetting : ->
    Device.getSetting("fast", false)

  setFastSetting : (value) ->
    Device.setSetting("fast", value)

  playSound : (sound) ->
    return if not @getSoundSetting()
    sound = "/data/sounds/#{sound}"
    eburp.resources.load sound, (resource) ->
      resource.data.volume = 0.25
      resource.data.play()

  playMusic : (track,musicOn=@getMusicSetting()) ->
    @music = track
    return if not musicOn
    track = "/data/music/#{track}"
