diff options
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) |
