     item_location: item_location
     bot: (render: renderBot)
     commands: [ ]
-    current_command: 0
+    next_command: 0
+    show_current_command: -1
     render: renderLevel
     animate: animateLevel
     step: stepLevelSimulation
 
-    mode: levelMode.PLAYING
-    animation_mode: levelAnimMode.READY
-
-    advanceCurrentCommand: ->
+    advanceNextCommand: ->
       switch @mode
-        when levelMode.PLAYING, levelMode.FULLPLAYING
-          @current_command++
-        when levelMode.REVPLAYING
-          @current_command--
+        when levelMode.PLAY, levelMode.PLAYFWD
+          @next_command++
+        when levelMode.PLAYREV
+          @next_command--
     reset: resetLevel
     resetAndRun: resetAndRunLevel
   o.reset()

  #console.log("mode = " + @mode + " animMode = " + @animation_mode)

  if @animation_mode == levelAnimMode.READY
    if @mode == levelMode.PLAYING
      @show_current_command = null
    else
      @show_current_command = @current_command
    @bot.showxi = @bot.xi
    @bot.showyi = @bot.yi
    @bot.showdir = @bot.dir

    next_move_control =
      start: (t: t, x: @bot.xi, y: @bot.yi, dir: @bot.dir)
      duration: 1/bot_speed
    if @step()
      @move_control = next_move_control
      @animation_mode = levelAnimMode.MOVING

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

  return

stepLevelSimulation = ->
  # TODO: detect illegal moves (obstacles), show error
  if @mode == levelMode.TURNAROUND
    # NOTE: even TURNAROUND might fail if something hits you
    return true

  @commands[@next_command].action(this)
  @advanceNextCommand()

  return true

setupLevel = (initial_bot_location, item_location) ->
  o =
