2D Flocking Demo's icon

2D Flocking Demo 1.0 Demos 3.1 Community

Submitted by user meloonics; GPLv3; 2020-01-15

This demo demostrates how different forces act upon a simple vehicle. This can be used to figure out your NPC AI, Particle movement or for education purposes. The project is based on "The Nature of Code" by Daniel Shiffman and I encourage you to read it and support the original author: https://natureofcode.com/

Forces implemented in this demo are:
*A simple Target-seeking force without pathfinding
*group forces like separation, alignment and cohesion, which are important for flocking behaviour
*mass-based forces like wind or gravity
*a random-movement-force based on Perlin-Noise
*friction/velocity-loss over time.

Feel free to use the project however you please. I tried to comment the code as much and as unerstandably as possible.


View files Download Submit an issue Recent Edits