Example #1
0
        public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
        {
            base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);

            // Remove purchase menu option if needed
            if (!Guide.IsTrialMode)
            {
                if (!purchased)
                {
                    // Remove the purchase menu option
                    MenuEntries.Remove(purchaseMenuEntry);

                    // Set selected entry to first entry
                    SelectedEntry = 0;
                }

                purchased = true;
            }

#if XBOX
            GamePadState gamePadState = GamePad.GetState(ActivePlayer.PlayerIndex);
            if (gamePadState.IsButtonDown(Buttons.LeftTrigger) && gamePadState.IsButtonDown(Buttons.RightTrigger) &&
                gamePadState.IsButtonDown(Buttons.LeftShoulder) && gamePadState.IsButtonDown(Buttons.RightShoulder) &&
                gamePadState.IsButtonDown(Buttons.X) && gamePadState.IsButtonDown(Buttons.B))
            {
                ActivePlayer.Profile.DeleteSaveFile();
            }
#else
            KeyboardState keyboardState = Keyboard.GetState();
            if (keyboardState.IsKeyDown(Keys.LeftShift) && keyboardState.IsKeyDown(Keys.RightShift))
            {
                ActivePlayer.Profile.DeleteSaveFile();
            }
#endif
        }
Example #2
0
        void upgradeBulletSpeed(object sender, PlayerIndexEventArgs e)
        {
            if (theGame.coins >= theGame.bulletSpeedCost)
            {
                theGame.bulletSpeed += 50f;
                theGame.coins       -= theGame.bulletSpeedCost;

                theGame.bulletSpeedCost += theGame.bulletSpeedCost / 2;

                if (theGame.bulletSpeed >= theGame.maxBulletSpeed)
                {
                    MenuEntries.Remove(bulletSpeed);
                }

                updateText();
            }
        }
Example #3
0
        void upgradeShotTime(object sender, PlayerIndexEventArgs e)
        {
            if (theGame.coins >= theGame.shotTimeCost)
            {
                theGame.shotTime -= 0.05f;
                theGame.coins    -= theGame.shotTimeCost;

                theGame.shotTimeCost += theGame.shotTimeCost / 2;

                if (theGame.shotTime <= theGame.minShotTime)
                {
                    MenuEntries.Remove(shotTime);
                }

                updateText();
            }
        }
Example #4
0
        void upgradeDamage(object sender, PlayerIndexEventArgs e)
        {
            if (theGame.coins >= theGame.damageCost)
            {
                theGame.bulletDamage += 1;
                theGame.coins        -= theGame.damageCost;

                theGame.damageCost += theGame.damageCost / 2;

                if (theGame.bulletDamage >= theGame.maxBulletDamage)
                {
                    MenuEntries.Remove(bulletDamage);
                }

                updateText();
            }
        }
Example #5
0
        void upgradeHits(object sender, PlayerIndexEventArgs e)
        {
            if (theGame.coins >= theGame.hitsCost)
            {
                theGame.bulletHits += 1;
                theGame.coins      -= theGame.hitsCost;

                theGame.hitsCost += theGame.hitsCost / 2;

                if (theGame.bulletHits >= theGame.maxBulletHits)
                {
                    MenuEntries.Remove(bulletHits);
                }

                updateText();
            }
        }
Example #6
0
        void upgradeSpeed(object sender, PlayerIndexEventArgs e)
        {
            if (theGame.coins >= theGame.speedCost)
            {
                theGame.speed += 50;
                theGame.coins -= theGame.speedCost;

                theGame.speedCost += theGame.speedCost / 2;

                if (theGame.speed >= theGame.maxSpeed)
                {
                    MenuEntries.Remove(speedUpgrade);
                }

                updateText();
            }
        }
Example #7
0
        void upgradeAir(object sender, PlayerIndexEventArgs e)
        {
            if (theGame.coins >= theGame.airCost)
            {
                theGame.air   += 10;
                theGame.coins -= theGame.airCost;

                theGame.airCost += theGame.airCost / 2;

                if (theGame.air >= theGame.maxAir)
                {
                    MenuEntries.Remove(airUpgrade);
                }

                updateText();
            }
        }
Example #8
0
        void upgradeHealth(object sender, PlayerIndexEventArgs e)
        {
            if (theGame.coins >= theGame.healthCost)
            {
                theGame.health += 2;
                theGame.coins  -= theGame.healthCost;

                theGame.healthCost += theGame.healthCost / 2;

                if (theGame.health >= theGame.maxHealth)
                {
                    MenuEntries.Remove(healthUpgrade);
                }

                updateText();
            }
        }
Example #9
0
 public void RemoveMenuEntry(Sprite2DObject item)
 {
     MenuEntries.Remove(item);
 }