hp
toc

Shaper

2015-05-10, post № 27

programming, Pygame, Python, #black, #change, #changing, #monochrome, #monochrome polygon, #mouse, #movement, #moving, #polygon, #pseudo random, #random, #red, #shapes, #shaping

Playing around with randomness I came up with this program which randomly generates various shapes. It starts off with one point in the center which will start randomly moving. By clicking on the screen you can generate new points or remove previous ones. If the number of points gets higher than 𝟤, a monochrome polygon will be displayed (using the pygame.polygon() function).

Usage

  • Left-clicking generates a new point,
  • Right-clicking removes a previous point.
shaper-2.png
shaper-3.png
shaper-4.png
Source code: shaper.py
Extra assets: shaper-1.png
Jonathan Frech's blog; built 2024/04/13 20:55:09 CEST