public void draw(SpriteBatch spriteBatch) { spriteBatch.End(); spriteBatch.Begin(); starfield.draw(spriteBatch); spriteBatch.End(); //Begin spritebatch spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, camera.Transform); //spawnBackground(spriteBatch); //backgrounds.draw(spriteBatch); //starfield.draw(spriteBatch, camera); //Draw planet(s) for (int i = 0; i < solar_systems.Count; i++) { solar_systems[i].draw(spriteBatch); } player.draw(spriteBatch); asteroid.draw(spriteBatch); foreach (Enemy enemy in enemies) { enemy.Draw(spriteBatch); } for (int i = 0; i < mother_ships.Count; i++) { mother_ships[i].Draw(spriteBatch); } rogue.draw(spriteBatch); particle_manager.draw(spriteBatch); map.draw(spriteBatch); //End spriteBatch spriteBatch.End(); //Draw heads up display spriteBatch.Begin(); spriteBatch.Draw(Constant.health_bar, Vector2.Zero, player.healthSourceRect, Color.White, 0f, Vector2.Zero, 0.7f, SpriteEffects.None, 0f); spriteBatch.DrawString(Constant.score_font, "Score: " + score.ToString(), new Vector2(860, 0), Color.White); if (player.isDestroyed) { spriteBatch.DrawString(Constant.score_font, "Game Over!", new Vector2(450, 200), Color.Red); GameOverScreen.score = score; Game1.current_game_state = Game1.GameState.GameOver; } spriteBatch.End(); }
public void draw(SpriteBatch spriteBatch) { starfield.draw(spriteBatch); for (int i = (planet_frame_count - 1); i >= 0; i--) { spriteBatch.Draw(Constant.planet_tex, new Vector2(500, 300 + i * planet_sep), new Rectangle((planet_frame_count - i) * planet_width, 0, planet_width, planet_height), Color.Yellow, rotation + 180 + 0.6f, new Vector2((float)(planet_width / 2), (float)(planet_height / 2)), 4f, SpriteEffects.None, 0f); } spriteBatch.DrawString(Constant.score_font, "Game Over!", new Vector2(350, 30), Color.Red, 0f, Vector2.Zero, 3f, SpriteEffects.None, 0f); spriteBatch.DrawString(Constant.score_font, "Score: " + score, new Vector2(400, 100), Color.White, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); spriteBatch.DrawString(Constant.score_font, "B/Back - Main Menu", new Vector2(50, 550), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); }
public void draw(SpriteBatch spriteBatch) { starfield.draw(spriteBatch); for (int i = (planet_frame_count - 1); i >= 0; i--) { spriteBatch.Draw(Constant.planet_tex, new Vector2(500, 300 + i * planet_sep), new Rectangle((planet_frame_count - i) * planet_width, 0, planet_width, planet_height), Color.Yellow, rotation + 180 + 0.6f, new Vector2((float)(planet_width / 2), (float)(planet_height / 2)), 4f, SpriteEffects.None, 0f); } spriteBatch.DrawString(Constant.score_font, "Controls!", new Vector2(350, 30), Color.White, 0f, Vector2.Zero, 3f, SpriteEffects.None, 0f); spriteBatch.DrawString(Constant.score_font, "Embark on your arcade-y mission pilot!", new Vector2(40, 100), Color.White, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); spriteBatch.DrawString(Constant.score_font, "Protect your solar system from invaders!", new Vector2(20, 150), Color.White, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); spriteBatch.DrawString(Constant.score_font, "A - Selection", new Vector2(50, 300), Color.White, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); spriteBatch.DrawString(Constant.score_font, "B/Back - Back", new Vector2(50, 350), Color.White, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); spriteBatch.DrawString(Constant.score_font, "RT/Space - Fire", new Vector2(50, 400), Color.White, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); spriteBatch.DrawString(Constant.score_font, "Start - Pause", new Vector2(600, 300), Color.White, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); spriteBatch.DrawString(Constant.score_font, "LS/W - Thrusters", new Vector2(600, 350), Color.White, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); spriteBatch.DrawString(Constant.score_font, "RS/A/D - Turn", new Vector2(600, 400), Color.White, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); spriteBatch.DrawString(Constant.score_font, "It is highly recommended that you play with an Xbox360/XboxOne GamePad", new Vector2(80, 550), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); }
public void draw(SpriteBatch spriteBatch) { starfield.draw(spriteBatch); btnControls.Draw(spriteBatch); btnStart.Draw(spriteBatch); spriteBatch.DrawString(Constant.score_font, "Planet Protectors", new Vector2(280, 200), Color.White, 0f, Vector2.Zero, 2f, SpriteEffects.None, 0f); for (int i = (planet_frame_count - 1); i >= 0; i--) { spriteBatch.Draw(Constant.planet_tex, new Vector2(150, 400 + i * planet_sep), new Rectangle((planet_frame_count - i) * planet_width, 0, planet_width, planet_height), Color.DeepSkyBlue, rotation + 180 + 0.6f, new Vector2((float)(planet_width / 2), (float)(planet_height / 2)), 4f, SpriteEffects.None, 0f); } for (int i = (planet_frame_count - 1); i >= 0; i--) { spriteBatch.Draw(Constant.planet_tex, new Vector2(800, 100 + i * planet_sep), new Rectangle((planet_frame_count - i) * planet_width, 0, planet_width, planet_height), Color.Yellow, rotation + 180 + 0.6f, new Vector2((float)(planet_width / 2), (float)(planet_height / 2)), 4f, SpriteEffects.None, 0f); } //Renderer.FillRectangle(spriteBatch, selector_position, 50, 50, Color.CornflowerBlue); for (int i = (ship_frame_count - 1); i >= 0; i--) { spriteBatch.Draw(Constant.ship_tex, new Vector2(selector_position.X, selector_position.Y + i * ship_sep), new Rectangle((ship_frame_count - i) * ship_width, 0, ship_width, ship_height), Color.White, 180 + 0.6f, new Vector2((float)(ship_width / 2), (float)(ship_height / 2)), 1f, SpriteEffects.None, 0f); } }