/// <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); }
/// <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); } } }
/// <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); }