Colored Rectangles
2016-01-30, post № 102
programming, Pygame, Python, #color, #mouse, #mouse controlled, #polygons, #rect, #rectangle, #rects
This program lets you spawn in a rectangle with a randomly assigned color. This rectangle will then slowly move towards the screen’s edge, eventually fading away.
Controls
- Left click spawns in a new rectangle at current mouse position,
- ‘Space’ takes a screenshot.
Source code: colored-rectangles.py