1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
class Factory
class Bullet
def self.new(x:, y:, damage: 10, vx: 10, vy: 0)
#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: vx, vy: vy, w: 16, h: 16),
FF::Cmp::SingletonCamera[0],
FF::Cmp::Hitcircle.new(r: 20),
FF::Cmp::Hp.new(health: 1),
FF::Cmp::Team.new,
FF::Cmp::CollisionDamage.new(damage: damage),
FF::Cmp::SingletonBullet[0],
)
end
end
end
|