diff options
Diffstat (limited to 'app/factories')
| -rw-r--r-- | app/factories/bullet.rb | 17 | ||||
| -rw-r--r-- | app/factories/ships/osprey.rb | 22 |
2 files changed, 39 insertions, 0 deletions
diff --git a/app/factories/bullet.rb b/app/factories/bullet.rb new file mode 100644 index 0000000..160613c --- /dev/null +++ b/app/factories/bullet.rb @@ -0,0 +1,17 @@ +class Factory + class Bullet + def self.new(damage: 10, x:, y:) + puts 'new ent created' + sprite = FF::Cmp::Sprite.new + sprite.props[:path] = 'sprites/kenny/Tiles/tile_0000.png' + FF::Ent.new( + sprite, + FF::Cmp::Boid.new(x: x, y: y, vx: 10, w: 16, h: 16), + FF::Cmp::SingletonCamera[0], + FF::Cmp::Hitcircle.new(r: 10), + FF::Cmp::Hp.new(health: 1), + FF::Cmp::CollisionDamage.new(damage: damage), + ) + end + end +end diff --git a/app/factories/ships/osprey.rb b/app/factories/ships/osprey.rb new file mode 100644 index 0000000..1f57cb1 --- /dev/null +++ b/app/factories/ships/osprey.rb @@ -0,0 +1,22 @@ +class Factory + class Osprey + def self.new(x: x, y: y) + sprite = FF::Cmp::Sprite.new + sprite.props[:path] = 'sprites/kenny/Ships/Osprey.png' + FF::Ent.new( + FF::Cmp::Boid.new(x: x, y: y, vx: 25, vy: 25, w: 32, h: 32), + sprite, + FF::Cmp::BoidBounds.new(strength: 0.6), + FF::Cmp::BoidsAlignment.new(strength: 1), + FF::Cmp::BoidsSeparation.new(distance: 150, strength: 0.001), + FF::Cmp::BoidsCohesion.new(strength: 10000), + FF::Cmp::Hp.new(health: 100), + FF::Cmp::CollisionDamage.new(damage: 100), + FF::Cmp::Hitcircle.new(r: 12), + FF::Cmp::DebugVectorArrow[0], + FF::Cmp::SingletonCamera[0], + ) + end + end +end + |
