   (x1-x0)*t + x0
 
 animateLevel = (t) ->
-
-  if @mode == levelMode.STOPPED or
-     (@mode == levelMode.PLAYING and @animation_mode == levelAnimMode.READY)
+  console.log("mode = " + @mode + " animMode = " + @animation_mode)
+
+  if @mode == levelMode.STOPPED or @animation_mode == levelAnimMode.READY
     @show_current_command = @current_command
     @bot.showxi = @bot.xi
     @bot.showyi = @bot.yi


  level.commands = level.commands[...-1]

  if level.current_command >= level.commands.length
    level.resetAndRun()
    while level.step()
      true


arrowButtonRender = (ctx) ->
  renderArrow(ctx, @dir.theta, inner_control_size)

  @bot.showyi = @bot.yi = @initial_bot_location.yi
  @bot.showdir = @bot.dir = @initial_bot_location.dir

  @mode = levelMode.PLAYING
  @current_command = 0

  return
