public override void Update(GameTime gameTime) { base.Update(gameTime); if (SourceRectangle.HasValue) { fadingFont.Position = new Vector2(Position.X, Top + 60) - fadingFont.Size / 2;// - 120); } fadingFont.Update(gameTime); }
/// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Update(GameTime gameTime) { currentKeyboardState = Keyboard.GetState(); currentMS = Mouse.GetState(); titleText1.Update(gameTime); titleText2.Update(gameTime); titleText3.Update(gameTime); colorfulTypingText.Update(gameTime); regularTypingText.Update(gameTime); by.Update(gameTime); foreach (SlidingFont slidingFont in slidingText) { slidingFont.Update(gameTime); } insertCoins.Update(gameTime); //If we can insert a coin and we in fact did if (insertCoins.IsVisible && ((currentKeyboardState.IsKeyDown(Keys.Space) && lastKeyboardState.IsKeyUp(Keys.Space)) || (currentKeyboardState.IsKeyDown(Keys.Enter) && lastKeyboardState.IsKeyUp(Keys.Enter)))) { coinsEffect.Play(); CoinsInserted++; //Alex's awesome reset foreach (SlidingFont slidingFont in slidingText) { slidingFont.Reset(true); } } coolPanel.Update(gameTime); insertFive.Update(gameTime); donateHundred.Update(gameTime); noCoinSpam.Update(gameTime); allAchievementsDone.Update(gameTime); base.Update(gameTime); lastKeyboardState = currentKeyboardState; }