summaryrefslogtreecommitdiffhomepage
path: root/app/systems/rules/decay_speed.rb
blob: dd7761f17f57a48e7de91ed720c0713a4dd7e57a (plain)
1
2
3
4
5
6
7
8
9
10
11
FF::Scn::BoidRules.add(
  FF::Sys.new('DecaySpeed', priority: 50) do
    FF::Cmp::DecaySpeed.each do |decay|
      boid = decay.entities[0].components[FF::Cmp::Boid][0]
      #boid.vx *= decay.strength
      #boid.vy *= decay.strength
      boid.cx += (boid.vx * decay.strength) - boid.vx
      boid.cy += (boid.vy * decay.strength) - boid.vy
    end
  end
)