summaryrefslogtreecommitdiffhomepage
path: root/app/systems/move_camera.rb
diff options
context:
space:
mode:
authorArnold <[email protected]>2021-12-26 18:39:15 -0500
committerGitHub <[email protected]>2021-12-26 18:39:15 -0500
commitb7dea8016b5b1328808e28b76cc12343907de63e (patch)
tree5339c23bbde03c4d6c8c79d96b2033ab9e838ec0 /app/systems/move_camera.rb
parentf70283e5ad5f5a5744ca0695a184f72f88803aca (diff)
downloadSteelWings-b7dea8016b5b1328808e28b76cc12343907de63e.tar.gz
SteelWings-b7dea8016b5b1328808e28b76cc12343907de63e.zip
implement ai randomizer, gameover screen, and other bug fixes
* Cleaned up factory. Fixed most bugs with death(last bug should be with move camera). * check if player entity is nil before shooting or moving camera * implement ai randomizer * separate button click detection to new system * implement gameover screen with button to return to menu * use reverse_each instead of cloning Co-authored-by: realtradam <[email protected]>
Diffstat (limited to 'app/systems/move_camera.rb')
-rw-r--r--app/systems/move_camera.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/app/systems/move_camera.rb b/app/systems/move_camera.rb
index 939ce56..fc22475 100644
--- a/app/systems/move_camera.rb
+++ b/app/systems/move_camera.rb
@@ -1,9 +1,11 @@
FF::Scn::Camera.add(
FF::Sys.new('MoveCamera', priority: 100) do
- camera = FF::Cmp::SingletonCamera[0]
- player_boid = FF::Cmp::SingletonPlayer[0].entities[0].components[FF::Cmp::Boid][0]
- camera.x = player_boid.x
- camera.y = player_boid.y
+ unless FF::Cmp::SingletonPlayer[0].entities[0].nil?
+ camera = FF::Cmp::SingletonCamera[0]
+ player_boid = FF::Cmp::SingletonPlayer[0].entities[0].components[FF::Cmp::Boid][0]
+ camera.x = player_boid.x
+ camera.y = player_boid.y
+ end
#mouse = $gtk.args.inputs.mouse
#camera_pos = [0,0]
#