Pygame Intro Builds

A grid where one click turns the lights on, and another click turns them off.

Single Lights On/Off

The first build project is a grid where clicking toggles the “lit” status of rectangles. The grid position of the mouse shows at the bottom of the window. Hitting “q” quits the animation.

Click Counter

Modify your program so that each square shows the number of times that you have clicked on it.

  • Adding mode (default): each click adds one.
  • Subtracting mode: each click subtracts one.
  • The space bar toggles you between adding and subtracting mode.
  • In subtracting mode, the grid coordinates of the mouse show in red. Otherwise they are black.
Last modified October 24, 2023: Description of introductory projects. (9d14025)