public void DrawL1(GameTime gameTime) { // now the user can actually play the game - this is level 1 spriteBatch.Begin(); background.Draw(spriteBatch); playerSprite.Draw(spriteBatch); yarnBalls.Draw(spriteBatch); // draw the bounding box if the user needs it if (showBB) { playerSprite.drawBB(spriteBatch, Color.Red); } spriteBatch.End(); }
/// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); // TODO: Add your drawing code here spriteBatch.Begin(); back1.Draw(spriteBatch); //*** grass1.Draw(spriteBatch); paddle.Draw(spriteBatch); //*** enemyList.Draw(spriteBatch); ballList.Draw(spriteBatch); booms.Draw(spriteBatch); spriteBatch.DrawString(font, "Enemies Slain: " + score, new Vector2(rhs - 140, top + 10), Color.Black); if (showbb) { paddle.drawBB(spriteBatch, Color.Black); paddle.drawHS(spriteBatch, Color.Green); enemyList.drawInfo(spriteBatch, Color.Red, Color.Yellow); LineBatch.drawLineRectangle(spriteBatch, playArea, Color.Blue); ballList.drawInfo(spriteBatch, Color.Gray, Color.Green); } spriteBatch.End(); base.Draw(gameTime); }
/// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.DeepSkyBlue); // TODO: Add your drawing code here spriteBatch.Begin(); scrollBack.Draw(spriteBatch); scrollFore.Draw(spriteBatch); particleList.Draw(spriteBatch); spritePlayer.Draw(spriteBatch); enemyList.Draw(spriteBatch); playerBulletList.Draw(spriteBatch); textScore.Draw(spriteBatch); //enter to start text if (!startGame) { textStartGame.Draw(spriteBatch); } //display bounding boxes if (showbb) { spritePlayer.drawBB(spriteBatch, Color.Red); LineBatch.drawLineRectangle(spriteBatch, playArea, Color.Purple); enemyList.drawInfo(spriteBatch, Color.Red, Color.Blue); playerBulletList.drawInfo(spriteBatch, Color.Red, Color.Blue); } spriteBatch.End(); base.Draw(gameTime); }
public override void Draw(GameTime gameTime) { graphicsDevice.Clear(Color.DeepSkyBlue); // TODO: Add your drawing code here spriteBatch.Begin(); scrollBack.colour = Color.Aqua; scrollBack.Draw(spriteBatch); scrollFore.Draw(spriteBatch); particleList.Draw(spriteBatch); player.Draw(spriteBatch); enemyList.Draw(spriteBatch); playerBulletList.Draw(spriteBatch); textScore.Draw(spriteBatch); //display bounding boxes if (Game1.showbb) { player.drawBB(spriteBatch, Color.Red); LineBatch.drawLineRectangle(spriteBatch, player.playArea, Color.Purple); enemyList.drawInfo(spriteBatch, Color.Red, Color.Blue); playerBulletList.drawInfo(spriteBatch, Color.Red, Color.Blue); } switch (levelState) { case LEVELSTATE.LEVELSTART: textVarious = new TextRenderable("LEVEL: " + level.ToString(), new Vector2(Game1.SCREEN_WIDTH / 2, Game1.SCREEN_HEIGHT / 2), spriteFont, Color.Red); textVarious.Draw(spriteBatch); textVarious = new TextRenderable("Enemies: " + enemyToSpawn.ToString(), new Vector2(Game1.SCREEN_WIDTH / 2, Game1.SCREEN_HEIGHT / 2 + 30), spriteFont, Color.Red); textVarious.Draw(spriteBatch); break; case LEVELSTATE.LEVELGAMEOVER: textVarious = new TextRenderable("GAME OVER", new Vector2(Game1.SCREEN_WIDTH / 2, Game1.SCREEN_HEIGHT / 2), spriteFont, Color.Red); textVarious.Draw(spriteBatch); textVarious = new TextRenderable("Press Q to go to menu.", new Vector2(Game1.SCREEN_WIDTH / 2, (Game1.SCREEN_HEIGHT / 2) + 30), spriteFont, Color.Red); textVarious.Draw(spriteBatch); break; case LEVELSTATE.LEVELFINISH: textVarious = new TextRenderable("LEVEL FINISHED", new Vector2(Game1.SCREEN_WIDTH / 2, Game1.SCREEN_HEIGHT / 2), spriteFont, Color.Red); textVarious.Draw(spriteBatch); textVarious = new TextRenderable("Press Enter to go to Next Level.", new Vector2(Game1.SCREEN_WIDTH / 2, Game1.SCREEN_HEIGHT / 2 + 30), spriteFont, Color.Red); textVarious.Draw(spriteBatch); break; } textLevel.Draw(spriteBatch); spriteBatch.End(); }