   level.commands = level.commands[...-1]
 
   level.resetAndRun()
-  while level.next_command < level.commands.length && level.step()
-    true
+  while level.next_command < level.commands.length
+    if !level.step()
+      level.reset()
+      break
 
   level.mode = levelMode.STOP
 

  for o in @obstacles
    if o.isHit(@bot.xi, @bot.yi, @frame)
      console.log("hit obstacle at frame " + @frame)
      # TODO: error display, take back move (I think that goes elsewhere)
      #return false

  @advanceNextCommand()


    o.render(ctx, show_frame, frame_t, t)

  # bot
  @bot.render(ctx,
    if @animation_mode == levelAnimMode.DYING
      (t - @move_control.start.t) * bot_speed
    else
      0
  )

  # commands
  ctx = prog_ctx
