summaryrefslogtreecommitdiffhomepage
path: root/app/systems
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2021-12-17 00:46:33 -0500
committerrealtradam <[email protected]>2021-12-17 00:46:33 -0500
commit8c918c1fadebfb076cafcb347b8aac0e8ac28882 (patch)
tree6a8771451ae2d9509a7931a48162a3138efc6818 /app/systems
parentd48fd199777cc17cf89d1e50d59852ad373de5b5 (diff)
downloadSteelWings-8c918c1fadebfb076cafcb347b8aac0e8ac28882.tar.gz
SteelWings-8c918c1fadebfb076cafcb347b8aac0e8ac28882.zip
Added Boid and Sprite component and systems
Diffstat (limited to 'app/systems')
-rw-r--r--app/systems/update_boid_sprite.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/systems/update_boid_sprite.rb b/app/systems/update_boid_sprite.rb
new file mode 100644
index 0000000..d600fa6
--- /dev/null
+++ b/app/systems/update_boid_sprite.rb
@@ -0,0 +1,9 @@
+FF::Scn::Render.add(
+ FF::Sys.new('UpdateBoidSprite', priority: 98) do
+ FF::Cmp::Boid.each do |boid|
+ boid.entities[0].components[FF::Cmp::Sprite][0].props[:x] = boid.x
+ boid.entities[0].components[FF::Cmp::Sprite][0].props[:y] = boid.y
+ # based on direction of the vector, needs to update the rotation of sprite too
+ end
+ end
+)