예제 #1
0
        /// <summary>
        /// Updates the beehive's status.
        /// </summary>
        /// <param name="gameTime">Game time information.</param>
        public override void Update(GameTime gameTime)
        {
            if (!gamePlayScreen.IsActive)
            {
                base.Update(gameTime);
                return;
            }

            // Initialize the first time honey was added
            if (lastTimeHoneyAdded == TimeSpan.Zero)
            {
                lastTimeHoneyAdded = gameTime.TotalGameTime;
                score.IncreaseCurrentValue(1);
            }
            else
            {
                // If enough time has passed add more honey
                if (lastTimeHoneyAdded + intervalToAddHoney < gameTime.TotalGameTime)
                {
                    lastTimeHoneyAdded = gameTime.TotalGameTime;
                    score.IncreaseCurrentValue(1);
                }
            }

            base.Update(gameTime);
        }
예제 #2
0
        /// <summary>
        /// Handle smoke logic.
        /// </summary>
        private void HandleSmoke()
        {
            // If not currently shooting, refill the gun
            if (!isSmokebuttonClicked)
            {
                smokeButtonScorebar.IncreaseCurrentValue(
                    ConfigurationManager.ModesConfiguration[gameDifficultyLevel].IncreaseAmountSpeed);

                beeKeeper.IsShootingSmoke = false;
            }
            else
            {
                // Check that the gun is not empty
                if (smokeButtonScorebar.CurrentValue <= smokeButtonScorebar.MinValue)
                {
                    beeKeeper.IsShootingSmoke = false;
                }
                else
                {
                    beeKeeper.IsShootingSmoke = true;

                    smokeButtonScorebar.DecreaseCurrentValue(
                        ConfigurationManager.ModesConfiguration[gameDifficultyLevel].DecreaseAmountSpeed);
                }
            }
        }
예제 #3
0
 /// <summary>
 /// Adds honey to the amount stored in the vat.
 /// </summary>
 /// <param name="value">Amount of honey to add.</param>
 public void IncreaseHoney(int value)
 {
     score.IncreaseCurrentValue(value);
 }