 
   @show_current_command = 0
   @next_command = 0
+  @frame = 0
 
   @mode = levelMode.STOP
+
+  @animation_mode = levelAnimMode.READY
+  delete @move_control
+  @last_t = Date.now()/1000
 
   return
 
 resetAndRunLevel = ->
   @reset()
   @mode = levelMode.PLAYFWD
-  @last_t = Date.now()/1000
-  @animation_mode = levelAnimMode.READY
-  delete @move_control
 
   return
 

  click: clickControlPanel

control_panel = setupControlPanel()
level_state = setupLevel((xi:0, yi:5, dir:0), (xi:6, yi:5))

stop = false


        @move_control = next_move_control
        @animation_mode = levelAnimMode.MOVING
        @show_current_command = step_command
      else
        # TODO: Need to play a death animation and restart

  # immediately run this if we switched to MOVING above
  if @animation_mode == levelAnimMode.MOVING
