summaryrefslogtreecommitdiffhomepage
path: root/app/systems/rules/alignment.rb
diff options
context:
space:
mode:
author_Tradam <[email protected]>2021-12-23 03:39:35 -0500
committerGitHub <[email protected]>2021-12-23 03:39:35 -0500
commitf70283e5ad5f5a5744ca0695a184f72f88803aca (patch)
treef9a182ccbc6ade03524f70f4483244a2e86ae6d1 /app/systems/rules/alignment.rb
parent18f869d18fac469e44f9a6a4772494a262c1b0cb (diff)
downloadSteelWings-f70283e5ad5f5a5744ca0695a184f72f88803aca.tar.gz
SteelWings-f70283e5ad5f5a5744ca0695a184f72f88803aca.zip
cleaned up boid rules, changed how strength works (#8)
Diffstat (limited to 'app/systems/rules/alignment.rb')
-rw-r--r--app/systems/rules/alignment.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/systems/rules/alignment.rb b/app/systems/rules/alignment.rb
index 2c2af11..cbb3d99 100644
--- a/app/systems/rules/alignment.rb
+++ b/app/systems/rules/alignment.rb
@@ -17,8 +17,8 @@ FF::Scn::BoidRules.add(
move_boid[0] /= boids_count - 1.0
move_boid[1] /= boids_count - 1.0
- boid_update.cx += (move_boid[0] - boid_update.vx) / alignment.strength
- boid_update.cy += (move_boid[1] - boid_update.vy) / alignment.strength
+ boid_update.cx += (move_boid[0] - boid_update.vx) * alignment.strength
+ boid_update.cy += (move_boid[1] - boid_update.vy) * alignment.strength
end
end
)