示例#1
0
        public override bool Shoot()
        {
            Bullet b;

            b = BulletManager.GetBullet(BulletManager.BulletType.BLUE);
            if (b != null)
            {
                if (bullet == ShootType.DIAGONAL)
                {
                    b.Shoot(Position - cannonOffset, new Vector2(-200, -200));
                }
                if (bullet == ShootType.VERTICAL)
                {
                    b.Shoot(Position - cannonOffset, new Vector2(0, -350));
                }
                ChangeBullets();
                return(true);
            }
            return(false);
        }
示例#2
0
        public override bool Shoot()
        {
            int shootType = RandomGenerator.GetRandom(0, 10);

            if (shootType % 2 == 0)
            {
                return(base.Shoot());
            }
            else
            {
                Bullet b;
                b = BulletManager.GetBullet(BulletManager.BulletType.FIRE);

                if (b != null)
                {
                    b.Shoot(Position - cannonOffset, new Vector2(Velocity.X - 300, 0));
                    return(true);
                }
                return(false);
            }
        }
示例#3
0
 public virtual void OnDie()
 {
     IsActive = false;
     //restore bullet
     BulletManager.RestoreBullet(this);
 }