summaryrefslogtreecommitdiffhomepage
path: root/app/tick.rb
diff options
context:
space:
mode:
author_Tradam <[email protected]>2021-12-18 22:51:31 -0500
committerGitHub <[email protected]>2021-12-18 22:51:31 -0500
commit55abb3c7534e57f8da270a7e77b16f3f06ca3712 (patch)
treeb40824f6d6588ebd5d7db2e7bfa6312d117ee419 /app/tick.rb
parent43a07949acca8a11a3aee6ea915a9a3e00b373ab (diff)
parent32a5e203e092dc22e7d1a34641b10692abe14702 (diff)
downloadSteelWings-55abb3c7534e57f8da270a7e77b16f3f06ca3712.tar.gz
SteelWings-55abb3c7534e57f8da270a7e77b16f3f06ca3712.zip
Merge branch 'master' into menu-dev
Diffstat (limited to 'app/tick.rb')
-rw-r--r--app/tick.rb75
1 files changed, 41 insertions, 34 deletions
diff --git a/app/tick.rb b/app/tick.rb
index 2a05891..c8c8f83 100644
--- a/app/tick.rb
+++ b/app/tick.rb
@@ -1,41 +1,48 @@
-#debug_arrow = FF::Cmp::DebugVectorArrow.new(length: 5)
-#position = [
-# {x: 100, y: 100},
-# {x: 500, y: 500},
-# {x: 700, y: 200},
-# {x: 150, y: 250},
-#]
-#position_range = (100..700).to_a
-#
-#25.times do |pos|
-# sprite = FF::Cmp::Sprite.new
-# sprite.props[:path] = 'sprites/kenny/Ships/ship_0011.png'
-# FF::Ent.new(
-# FF::Cmp::Boid.new(x: position_range.sample, y: position_range.sample, vx: 25, vy: 25),
-# sprite,
-# FF::Cmp::BoidBounds.new(strength: 1),
-# FF::Cmp::BoidsAlignment.new(strength: 1),
-# FF::Cmp::BoidsSeparation.new(distance: 150, strength: 0.01),
-# FF::Cmp::BoidsCohesion.new(strength: 100),
-# #debug_arrow,
-# )
-#end
-#FF::Ent.new(
-# FF::Cmp::Sprite.new,
-# FF::Cmp::Boid.new(x: 150, y: 250),
-# FF::Cmp::BoidBounds.new,
-#FF::Cmp::BoidsAlignment.new,
-# FF::Cmp::BoidsSeparation.new(strength: 1.0),
-# #FF::Cmp::BoidsCohesion.new,
-# debug_arrow,
-#)
-#FF::Scn::Debug.add(FF::Sys::DebugRenderVectorArrow)
-#@pause = true
-#FF::Stg.remove FF::Scn::BoidRules
+
+#FF::Cmp::Boid.new(x: position_range.sample, y: position_range.sample, vx: 25, vy: 25, w: sprite.props[:w], h: sprite.props[:h]),
+#FF::Cmp::SingletonCamera[0],
+
+#@pause = false
+@camera = FF::Cmp::SingletonCamera[0]
+
FF::Sys::InitTitleScreen.call
def tick args
args.outputs.background_color = [0,0,0]
FelFlame::Stage.call
+
+ # Moving Camera
+ if args.inputs.keyboard.keys[:down_or_held].include?(:d)
+ @camera.x += (Math.cos([email protected] * (Math::PI / 180.0)) * 5)
+ @camera.y += (Math.sin([email protected] * (Math::PI / 180.0)) * 5)
+ end
+ if args.inputs.keyboard.keys[:down_or_held].include?(:a)
+ @camera.x += (Math.cos([email protected] * (Math::PI / 180.0)) * -5)
+ @camera.y += (Math.sin([email protected] * (Math::PI / 180.0)) * -5)
+ end
+ if args.inputs.keyboard.keys[:down_or_held].include?(:w)
+ #@camera.y += 5
+ @camera.x -= (Math.sin([email protected] * (Math::PI / 180.0)) * 5)
+ @camera.y += (Math.cos([email protected] * (Math::PI / 180.0)) * 5)
+ end
+ if args.inputs.keyboard.keys[:down_or_held].include?(:s)
+ #@camera.y -= 5
+ @camera.x -= (Math.sin([email protected] * (Math::PI / 180.0)) * -5)
+ @camera.y += (Math.cos([email protected] * (Math::PI / 180.0)) * -5)
+ end
+ if args.inputs.keyboard.keys[:down_or_held].include?(:q)
+ @camera.angle += 3
+ end
+ if args.inputs.keyboard.keys[:down_or_held].include?(:e)
+ @camera.angle -= 3
+ end
+ if args.inputs.keyboard.keys[:down_or_held].include?(:z)
+ @camera.zoom *= 1.05
+ end
+ if args.inputs.keyboard.keys[:down_or_held].include?(:x)
+ @camera.zoom *= 0.95
+ end
+
+ # Pausing
if args.inputs.keyboard.keys[:down].include?(:right)
FF::Scn::BoidRules.call
end