jblog
toc

Circle crawler

2015-04-19, post № 20

programming, Pygame, Python, #around, #around the center, #black, #center, #change, #changing, #circle, #distance, #fill, #filling, #move, #movement, #moving, #red, #relation, #vec, #vector

In this program there are entities equally positioned around the center. As the entities begin to move, they can either go toward the center, away from the center or stay. You can toggle if the entities move and if the screen gets refilled. The code is based on ‘Circle Walk II’, but the calculation for the entities to move in relation to the center is achieved by using vectors.

Usage

  • ‘m’ to toggle if entities are moving,
  • ‘f’ to toggle if the screen gets refilled.
circle-crawler-1.png
circle-crawler-2.png
circle-crawler-3.png
Source code: circle-crawler.py