public override void Draw() { _background.Draw(spriteBatch); drawGUIText(); if (currentState != ScreenState.NORMAL) { spriteBatch.Draw(_blackTex, new Rectangle(0, 0, graphics.Viewport.Width, graphics.Viewport.Height), new Color(0, 0, 0, _blackTexAlpha)); } }
public override void Draw() { background.Draw(spriteBatch); for (int i = 0; i < NUM_ASTEROIDS + NUM_POWERUPS; i++) { asteroids[i].Draw(spriteBatch); } foreach (PowerUpText txt in powerUpText) { txt.Draw(spriteBatch); } player1.Draw(spriteBatch); player2.Draw(spriteBatch); drawPlayer1UI(spriteBatch); drawPlayer2UI(spriteBatch); if (currentState == ScreenState.FADE_IN) { spriteBatch.Draw(blackTex, new Rectangle(0, 0, graphics.Viewport.Width, graphics.Viewport.Height), new Color(0, 0, 0, blackTexAlpha)); } // Countdown TODO: Clean Up, separate function maybe Vector2 stringSize = fontCountdown.MeasureString(currentCount); Vector2 tmpVect = new Vector2((graphics.Viewport.Width - stringSize.X) / 2, (graphics.Viewport.Height - stringSize.Y) / 2); if (currentState == ScreenState.COUNTDOWN) { spriteBatch.DrawString(fontCountdown, currentCount, tmpVect, Color.Red, 0.0f, new Vector2(stringSize.X / 2, stringSize.Y / 2), countDownScale, SpriteEffects.None, 0); } // GAMEOVER state stringSize = fontUI.MeasureString(winner) * 8; tmpVect = new Vector2((graphics.Viewport.Width / 2 - stringSize.X / 2), (graphics.Viewport.Height - stringSize.Y) / 2); if (currentState == ScreenState.GAMEOVER) { spriteBatch.DrawString(fontUI, winner, tmpVect, Color.Red, 0.0f, Vector2.Zero, 8.0f, SpriteEffects.None, 0); } // Weapon Label player 1 string output = "Gemini Missile: "; switch (player1.currentWeapon) { case CommandCenter.WeaponsList.GEMINI_MISSILE: output = "Gemini Missile: "; break; case CommandCenter.WeaponsList.PORT_MISSILE: output = "PORT Missile: "; break; case CommandCenter.WeaponsList.CRUSADER_MISSILE: output = "Crusader Missile: "; break; default: break; } ; stringSize = fontCountdown.MeasureString(output); tmpVect = new Vector2(25, 60); output += player1.Weapons[player1.currentWeapon]; spriteBatch.DrawString(fontUI, output, tmpVect, Color.LimeGreen, 0.0f, Vector2.Zero, 1, SpriteEffects.None, 0); // Player 1 Stasis Timer tmpVect = new Vector2(25, 80); if (player1.stasisDelay > 0) { spriteBatch.DrawString(fontUI, "In Stasis: " + player1.stasisDelay, tmpVect, Color.Red, 0.0f, Vector2.Zero, 1, SpriteEffects.None, 0); } // Weapon Label player 2 string output2 = "Gemini Missile: "; switch (player2.currentWeapon) { case CommandCenter.WeaponsList.GEMINI_MISSILE: output2 = "Gemini Missile: "; break; case CommandCenter.WeaponsList.PORT_MISSILE: output2 = "PORT Missile: "; break; case CommandCenter.WeaponsList.CRUSADER_MISSILE: output2 = "Crusader Missile: "; break; default: break; } ; Vector2 tmpVect2 = new Vector2(graphics.Viewport.Width - 145, graphics.Viewport.Height - 60); output2 += player2.Weapons[player2.currentWeapon]; spriteBatch.DrawString(fontUI, output2, tmpVect2, Color.LimeGreen, 0.0f, Vector2.Zero, 1, SpriteEffects.None, 0); // Player 2 Stasis Timer tmpVect2 = new Vector2(graphics.Viewport.Width - 145, graphics.Viewport.Height - 40); if (player2.stasisDelay > 0) { spriteBatch.DrawString(fontUI, "In Stasis: " + player2.stasisDelay, tmpVect2, Color.Red, 0.0f, Vector2.Zero, 1, SpriteEffects.None, 0); } // Draw Particles particleSystem.Draw(spriteBatch); } //public override void Draw()
}//public override void LoadContent() public override void Draw() { bg.Draw(spriteBatch); }//public override void Draw()