Flocking Simulation
Created with Notepad++ & Google Chrome
Development time: One evening
Development team: Me
Development time: One evening
Development team: Me
WARNING! This isn't formatted nicely for html, and therefore sliders might be located in odd places. Sorry =)
This code was originally developed by Daniel Shiffman, but I have optimized and modified it in the following ways:
Slider Functions are ordered as follows (too lazy to add labels and format properly):
Align Max Force
Cohesion Max Speed
Separation Perception Radius
This code was originally developed by Daniel Shiffman, but I have optimized and modified it in the following ways:
- Objects at x=width-1 now consider objects at x=1 (think of wrapping)
- Added sliders for max force, max speed, and perception range.
- Optimized range detection by running a range function once, instead of once per each force.
- TODO: Implement quadtree subdivision for performance
- TODO: Maybe add a bad guy that chases the objects (think of cat vs mice)
Slider Functions are ordered as follows (too lazy to add labels and format properly):
Align Max Force
Cohesion Max Speed
Separation Perception Radius