diff options
| author | _Tradam <[email protected]> | 2021-12-19 22:22:53 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-12-19 22:22:53 -0500 |
| commit | 6c09e4a4fb4413c83c029e793ba0bab4ac915388 (patch) | |
| tree | cfd6ac20ee0ff64f04ec187f44fd229d7330168a /app | |
| parent | d51367b072e7cd160421e9e6e04f71510785ccd4 (diff) | |
| parent | 9419c8e708bfde4344c60d99f2a44027f4ee9b95 (diff) | |
| download | SteelWings-6c09e4a4fb4413c83c029e793ba0bab4ac915388.tar.gz SteelWings-6c09e4a4fb4413c83c029e793ba0bab4ac915388.zip | |
Merge pull request #5 from realtradam/background-dev
background added
Diffstat (limited to 'app')
| -rw-r--r-- | app/components/ground_sprite.rb | 21 | ||||
| -rw-r--r-- | app/components/rules/bounds.rb | 4 | ||||
| -rw-r--r-- | app/systems/start_game.rb | 10 |
3 files changed, 33 insertions, 2 deletions
diff --git a/app/components/ground_sprite.rb b/app/components/ground_sprite.rb new file mode 100644 index 0000000..01602c5 --- /dev/null +++ b/app/components/ground_sprite.rb @@ -0,0 +1,21 @@ +FF::Cmp.new("Sprite", props: { + x: 640 - 50, + y: 360 - 50, + w: 100, + h: 100, + path: 'sprites/hexagon/red.png', + angle: 0, + a: 255, + r: 255, + g: 255, + b: 255, + source_x: 0, + source_y: 0, + source_w: -1, + source_h: -1, + flip_vertically: false, + flip_horizontally: false, + angle_anchor_x: 0.5, + angle_anchor_y: 0.5, + blendmode_enum: 1 +}) diff --git a/app/components/rules/bounds.rb b/app/components/rules/bounds.rb index 71495e6..7b0c86e 100644 --- a/app/components/rules/bounds.rb +++ b/app/components/rules/bounds.rb @@ -1,5 +1,5 @@ FF::Cmp.new('BoidBounds', - xmax: 1280, xmin: 0, - ymax: 720, ymin: 0, + xmax: 1280, xmin: -1280, + ymax: 1280, ymin: -1280, strength: 10) diff --git a/app/systems/start_game.rb b/app/systems/start_game.rb index da415ec..678100b 100644 --- a/app/systems/start_game.rb +++ b/app/systems/start_game.rb @@ -21,6 +21,13 @@ FF::Sys.new('StartGame', priority: 50 ) do ] position_range = (100..700).to_a + sprite = FF::Cmp::Sprite.new + sprite.props[:path] = 'sprites/background.png' + FF::Ent.new( + sprite, + FF::Cmp::SingletonCamera[0], + FF::Cmp::Boid.new(h: 1920 * 2, w: 1920 * 2) + ) 5.times do |pos| Factory::Osprey.new(x: position_range.sample, y: position_range.sample) end @@ -32,12 +39,15 @@ FF::Sys.new('StartGame', priority: 50 ) do sprite, debug_arrow, FF::Cmp::SingletonCamera[0], + FF::Cmp::BoidBounds.new, FF::Cmp::Follow.new(target: :mouse, strength: 500), FF::Cmp::SingletonPlayer[0], FF::Cmp::Team.new(team: 'player'), FF::Cmp::Weapon.new, ) + + FF::Stg.add( FF::Scn::BoidRules, FF::Scn::Camera, |
