     o.render(ctx, show_frame, frame_t, t)
 
   # bot
-  @bot.render(ctx)
+  @bot.render(ctx,
+    if @animation_mode == levelAnimMode.DYING
+      (t - @move_control.start.t) * bot_speed
+    else
+      0
+  )
 
   # commands
   ctx = prog_ctx

        @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
    rel_t = (t-@move_control.start.t)/@move_control.duration
    @bot.showxi = lerp rel_t, @move_control.start.x, @bot.xi
    @bot.showyi = lerp rel_t, @move_control.start.y, @bot.yi
    @bot.showdir = @bot.dir

    if rel_t >= 1
      @animation_mode = levelAnimMode.READY

  @last_t = t


levelAnimMode =
  READY: 1  # ready to run the next command
  MOVING: 2 # animating movement
  DYING: 3  # animating move into an invalid state

resetLevel = ->
  @bot.showxi = @bot.xi = @initial_bot_location.xi
