 
   # Handle hiding/showing the active scene
   changeScene: (scene, options) ->
+    throw new Error("Invalid scene '#{scene}") if @scenes[scene] == undefined
+
     @activeScene.hide()
-
-    switch scene
-      when 'title' then @activeScene = @scenes.title
-      when 'editor' then @activeScene = @scenes.editor
-      when 'about' then @activeScene = @scenes.about
-      when 'difficulty' then @activeScene = @scenes.difficultySelect
-      when 'level'
-        @activeScene = @scenes.levelSelect
-        @activeScene.difficulty = options.difficulty
-      when 'game'
-        # Set the game's diff & level props from the passed "options" arg
-        @activeScene = @scenes.game
-        @activeScene.difficulty = options.difficulty
-        @activeScene.level = options.level
-        @activeScene.tutorial = options.tutorial
-      else
-        console.log "Error! Scene not defined in switch statement"
-        @activeScene = @titleScene
+    @activeScene = @scenes[scene]
+
+    if options != undefined
+      for key, value of options
+        @activeScene[key] = value
 
     @activeScene.show()
 

    @sona.loop(id)
    @currentMusic = id

  # Stop music!
  stopMusic: ->
    return if not @currentMusic


        random: 0
      localStorage.setObject 'complete', complete

    if localStorage.getObject('lastViewedLevel') == null
      lastViewedLevel =
        beginner: 0
