summaryrefslogtreecommitdiffhomepage
path: root/app/factories/bullet.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/factories/bullet.rb')
-rw-r--r--app/factories/bullet.rb17
1 files changed, 17 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