summaryrefslogtreecommitdiffhomepage
path: root/app/systems/ai/scatter.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/systems/ai/scatter.rb')
-rw-r--r--app/systems/ai/scatter.rb15
1 files changed, 10 insertions, 5 deletions
diff --git a/app/systems/ai/scatter.rb b/app/systems/ai/scatter.rb
index 1469fd9..82bcb65 100644
--- a/app/systems/ai/scatter.rb
+++ b/app/systems/ai/scatter.rb
@@ -1,10 +1,15 @@
FF::Sys.new("Scatter", priority: 40) do
- FF::Cmp::BoidsSeparation.each do |sep|
- sep.distance = 200
+ FF::Cmp::SingletonRandomAIPick[0].entities.each do |entity|
+ sep = entity.components[FF::Cmp::BoidsSeparation][0]
+ # I did times 3 becase then it will always be greater then
+ # what it was before and that means it will force a
+ # seperation to happen even if the default value is
+ # changed and you forget to update this number here
+ sep.distance = Factory::SampleEnemy.defaults[:boids_seperation_distance] * 3
#puts 'remove align/cohesion/follow'.upcase
- alignment_mgr = sep.entities[0].components[FF::Cmp::BoidsAlignment]
- cohesion_mgr = sep.entities[0].components[FF::Cmp::BoidsCohesion]
- follow_mgr = sep.entities[0].components[FF::Cmp::Follow]
+ alignment_mgr = entity.components[FF::Cmp::BoidsAlignment]
+ cohesion_mgr = entity.components[FF::Cmp::BoidsCohesion]
+ follow_mgr = entity.components[FF::Cmp::Follow]
unless follow_mgr.nil? || follow_mgr.empty?
follow_mgr[0].delete
end