summaryrefslogtreecommitdiff
path: root/resources/js/flock.js
diff options
context:
space:
mode:
Diffstat (limited to 'resources/js/flock.js')
-rw-r--r--resources/js/flock.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/resources/js/flock.js b/resources/js/flock.js
new file mode 100644
index 0000000..952aecd
--- /dev/null
+++ b/resources/js/flock.js
@@ -0,0 +1,15 @@
+class Flock {
+ constructor() {
+ this.boids = [];
+ }
+
+ run() {
+ for (let i = 0; i < this.boids.length; i++) {
+ this.boids[i].run(boids);
+ }
+ }
+
+ addBoid(boid) {
+ this.boids.push(boid);
+ }
+}