summaryrefslogtreecommitdiffhomepage
path: root/lib/rules/limit.rb
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2021-08-10 00:15:17 -0400
committerrealtradam <[email protected]>2021-08-10 00:15:17 -0400
commitc34e1d372676709f4eb05237025c67b878bf76d6 (patch)
treeae410bde79e576edd2c43057ba0f0ff63627b4f7 /lib/rules/limit.rb
parentf80fd9ea0e340db6286feb014e437c9ca0c93dd0 (diff)
downloadruboids-c34e1d372676709f4eb05237025c67b878bf76d6.tar.gz
ruboids-c34e1d372676709f4eb05237025c67b878bf76d6.zip
readme and cleanup
Diffstat (limited to 'lib/rules/limit.rb')
-rw-r--r--lib/rules/limit.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rules/limit.rb b/lib/rules/limit.rb
index b2a8f32..5df8bc4 100644
--- a/lib/rules/limit.rb
+++ b/lib/rules/limit.rb
@@ -10,7 +10,7 @@ FF::Sys.new('Limit') do
end
absolute_velocity = Math.sqrt((boid.vx**2) + (boid.vy**2))
- if absolute_velocity > $config.limit
+ if absolute_velocity > ($config.limit * multi)
boid.vx = (boid.vx / absolute_velocity) * $config.limit * multi
boid.vy = (boid.vy / absolute_velocity) * $config.limit * multi
end