diff options
| author | arngo <[email protected]> | 2021-12-19 22:34:28 -0500 |
|---|---|---|
| committer | arngo <[email protected]> | 2021-12-19 22:34:33 -0500 |
| commit | 561ac9574a5afc88ac762edc8892353e678b1117 (patch) | |
| tree | b14bed88b44f3e5731243aa83b3e930e83f99455 /app/systems/rules | |
| parent | 0c2d73d8a43d8aab8f6549a738084a3f4d8549ce (diff) | |
| download | SteelWings-561ac9574a5afc88ac762edc8892353e678b1117.tar.gz SteelWings-561ac9574a5afc88ac762edc8892353e678b1117.zip | |
implemented speed decay
Diffstat (limited to 'app/systems/rules')
| -rw-r--r-- | app/systems/rules/decay_speed.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/systems/rules/decay_speed.rb b/app/systems/rules/decay_speed.rb new file mode 100644 index 0000000..490c7d0 --- /dev/null +++ b/app/systems/rules/decay_speed.rb @@ -0,0 +1,9 @@ +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 + end + end +) |
