20. Silly Square

  • A little square randomly drifts around the screen.
  • You win if you hit the “w” key.
  • Hitting the “r” key moves the square back to its starting position.
  • When you win, some win screen appears and the animation stops.

Items to practice:

  • stop-when clause in big bang
  • win screen draw-handler

Extras:

  • You lose if you hit the “q” key.
  • Also win if you click on the square.