summaryrefslogtreecommitdiffhomepage
path: root/lib/rules/target.rb
blob: ffee93a4c5d69fe3f18a7d6cb9aa9eb5d72baad5 (plain)
1
2
3
4
5
6
FF::Sys.new('Target', priority: 50) do
  FF::Cmp::Boids.each do |boid|
    boid.cx += ($x_target - boid.x) / $target_strength
    boid.cy += ($y_target - boid.y) / $target_strength
  end
end