diff options
| -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 | ||||
| -rw-r--r-- | sprites/background.png | bin | 0 -> 307676 bytes |
4 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 42a3916..8c71a6e 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::Debug, diff --git a/sprites/background.png b/sprites/background.png Binary files differnew file mode 100644 index 0000000..36da420 --- /dev/null +++ b/sprites/background.png |
