public void CreateBullet(CCPoint position, MovingObject target, int power) { var newBullet = (new BulletFactory()).Position(position) .Target(target) .Power(power) .Velocity(200f) .Create(); BulletCreated?.Invoke(newBullet); }
private void ShootBullet() { foreach (var offset in GetBulletOffsets()) { var bullet = BulletFactory.CreateNew(); bullet.Position = this.Position + offset; bullet.YVelocity = BulletVelocity; BulletCreated?.Invoke(bullet); } }