diff options
| author | realtradam <[email protected]> | 2021-08-09 05:17:42 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2021-08-09 05:17:42 -0400 |
| commit | 4e909c6b44794b76ef3a98c032ea90204b673f85 (patch) | |
| tree | 79cc49469447edf61ad835f61279bf48de51a61f /lib/02-apply_boid_calculations.rb | |
| parent | 4401e68464d1d5932daec84e41aeb7b4a88c831e (diff) | |
| download | ruboids-4e909c6b44794b76ef3a98c032ea90204b673f85.tar.gz ruboids-4e909c6b44794b76ef3a98c032ea90204b673f85.zip | |
cohesion and seperation
Diffstat (limited to 'lib/02-apply_boid_calculations.rb')
| -rw-r--r-- | lib/02-apply_boid_calculations.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/02-apply_boid_calculations.rb b/lib/02-apply_boid_calculations.rb new file mode 100644 index 0000000..250a394 --- /dev/null +++ b/lib/02-apply_boid_calculations.rb @@ -0,0 +1,15 @@ +FF::Scn::BoidCalculations.add(FF::Sys.new('ApplyBoidCalculations', priority: 51) do + FF::Cmp::Boids.each do |boid| + boid.vx += boid.cx + boid.vy += boid.cy + boid.x += boid.vx + boid.y += boid.vy + #boid.obj.x = boid.obj.x + #boid.vect.x1 = boid.obj.x + 7 + #boid.vect.y1 = boid.obj.y + 7 + #boid.vect.x2 = boid.obj.x + (boid.vx * 3) + 7 + #boid.vect.y2 = boid.obj.y + (boid.vy * 3) + 7 + boid.cx = 0 + boid.cy = 0 + end +end) |
