diff options
| author | arngo <[email protected]> | 2021-12-18 22:10:28 -0500 |
|---|---|---|
| committer | arngo <[email protected]> | 2021-12-18 22:10:28 -0500 |
| commit | 43a07949acca8a11a3aee6ea915a9a3e00b373ab (patch) | |
| tree | 8f6e1bba2e025dd11bffda46bd46b29535580be9 /app/systems/start_game.rb | |
| parent | b04f361c9430a3a3c29ef63a43884db0d168a808 (diff) | |
| download | SteelWings-43a07949acca8a11a3aee6ea915a9a3e00b373ab.tar.gz SteelWings-43a07949acca8a11a3aee6ea915a9a3e00b373ab.zip | |
implement button components and title screen
Diffstat (limited to 'app/systems/start_game.rb')
| -rw-r--r-- | app/systems/start_game.rb | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/app/systems/start_game.rb b/app/systems/start_game.rb new file mode 100644 index 0000000..2972209 --- /dev/null +++ b/app/systems/start_game.rb @@ -0,0 +1,42 @@ +FF::Sys.new('StartGame', priority: 50 ) do + FF::Cmp::Title[0].entities.each do |entity| + entity.components[FF::Cmp::Sprite][0].delete + entity.components[FF::Cmp::Button][0].delete + entity.components[FF::Cmp::Hitbox][0].delete + entity.delete + end + FF::Cmp::Title[0].delete + FF::Stg.remove FF::Scn::TitleScreen + + 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::Stg.add( + FF::Scn::BoidRules, + FF::Scn::Debug, + ) + + FF::Scn::Debug.add(FF::Sys::DebugRenderVectorArrow) + @pause = false + #FF::Stg.remove FF::Scn::BoidRules +end |
