summaryrefslogtreecommitdiffhomepage
path: root/app/systems/update_boid_position.rb
diff options
context:
space:
mode:
authorarngo <[email protected]>2021-12-17 21:19:15 -0500
committerarngo <[email protected]>2021-12-17 21:19:15 -0500
commitb8b008c726810dc5e3f18b5637a5e5c882da7dd4 (patch)
treea64630f800ca3cdd304cf664e27b03970c71aace /app/systems/update_boid_position.rb
parentc85f6533efb50981ef8cf59e840a1f8b58b4deef (diff)
downloadSteelWings-b8b008c726810dc5e3f18b5637a5e5c882da7dd4.tar.gz
SteelWings-b8b008c726810dc5e3f18b5637a5e5c882da7dd4.zip
add cohesion and debug stuff
Diffstat (limited to 'app/systems/update_boid_position.rb')
-rw-r--r--app/systems/update_boid_position.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/systems/update_boid_position.rb b/app/systems/update_boid_position.rb
new file mode 100644
index 0000000..50ab9a7
--- /dev/null
+++ b/app/systems/update_boid_position.rb
@@ -0,0 +1,11 @@
+FF::Scn::BoidRules.add(
+ FF::Sys.new('UpdateBoidPosition', priority: 98) do
+ FF::Cmp::Boid.each do |boid|
+ boid.vx += boid.cx
+ boid.vy += boid.cy
+ boid.x += boid.vx
+ boid.y += boid.vy
+ # TODO: based on direction of the vector, needs to update the rotation of sprite too
+ end
+ end
+)