summaryrefslogtreecommitdiffhomepage
path: root/lib/rules/limit.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rules/limit.rb')
-rw-r--r--lib/rules/limit.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/rules/limit.rb b/lib/rules/limit.rb
index c454de4..dba9f96 100644
--- a/lib/rules/limit.rb
+++ b/lib/rules/limit.rb
@@ -1,12 +1,12 @@
# This special function is already called by apply_boid_calculations.rb
# do not add or call this function elsewhere
FF::Sys.new('Limit') do
- unless $limit < 0
+ unless $config.limit < 0
FF::Cmp::Boids.each do |boid|
absolute_velocity = Math.sqrt((boid.vx**2) + (boid.vy**2))
- if absolute_velocity > $limit
- boid.vx = (boid.vx / absolute_velocity) * $limit
- boid.vy = (boid.vy / absolute_velocity) * $limit
+ if absolute_velocity > $config.limit
+ boid.vx = (boid.vx / absolute_velocity) * $config.limit
+ boid.vy = (boid.vy / absolute_velocity) * $config.limit
end
end
end