예제 #1
0
        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);
        }
예제 #2
0
        private void ShootBullet()
        {
            foreach (var offset in GetBulletOffsets())
            {
                var bullet = BulletFactory.CreateNew();
                bullet.Position  = this.Position + offset;
                bullet.YVelocity = BulletVelocity;

                BulletCreated?.Invoke(bullet);
            }
        }