示例#1
0
        public void ShootTripleShot(AmmoDrop initialDrop)
        {
            float yValue = initialDrop.position.Y + initialDrop.ObjectSize.Height / 2 - standartBulletSize.Height / 2;

            Vector2 leftBulletPosition  = new Vector2(initialDrop.position.X, yValue);
            Vector2 midleBulletPosition = new Vector2(initialDrop.position.X + initialDrop.ObjectSize.Width / 2 - standartBulletSize.Width / 2, yValue);
            Vector2 rightBulletPosition = new Vector2(initialDrop.position.X + initialDrop.ObjectSize.Width - standartBulletSize.Width, yValue);

            newBullet = new Bullet(BulletSkin, leftBulletPosition, standartBulletSize, 1, this);
            BulletList.Add(newBullet);
            newBullet = new Bullet(BulletSkin, midleBulletPosition, standartBulletSize, 0, this);
            BulletList.Add(newBullet);
            newBullet = new Bullet(BulletSkin, rightBulletPosition, standartBulletSize, 2, this);
            BulletList.Add(newBullet);
        }
示例#2
0
        public void SpawnDrops(int randomNumber)
        {
            Size    dropSize     = new Size(Convert.ToInt32(25 * CommonFunctions.aspectRatioMultiplierX), Convert.ToInt32(25 * CommonFunctions.aspectRatioMultiplierY));
            Vector2 dropPosition = CommonFunctions.DetermineDropPosition(this, dropSize);

            if (randomNumber == 1 || randomNumber == 2 || randomNumber == 3)
            {
                newAmmoDrop = new AmmoDrop(dropPosition, dropSize, AmmoDropSkin, this);
                CommonFunctions.ICollidableList.Add(newAmmoDrop);
            }

            if (randomNumber == 4 || randomNumber == 5 || randomNumber == 6 || randomNumber == 7 || randomNumber == 8)
            {
                newScoreDrop = new ScoreDrop(dropPosition, dropSize, ScoreDropSkin, this);
                CommonFunctions.ICollidableList.Add(newScoreDrop);
            }
        }