/// <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); }
public override void Draw(GameTime gameTime) { graphicsDevice.Clear(Color.BlanchedAlmond); spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied); scrolling1.Draw(spriteBatch); scrolling2.Draw(spriteBatch); back1.Draw(spriteBatch); //*** paddle.Draw(spriteBatch); //*** ball.draw(spriteBatch); if (p != null) { p.Draw(spriteBatch); } if (showbb) { paddle.drawBB(spriteBatch, Color.Black); paddle.drawHS(spriteBatch, Color.Green); dragonList.drawInfo(spriteBatch, Color.Red, Color.Blue); LineBatch.drawLineRectangle(spriteBatch, playArea, Color.Blue); ball.drawInfo(spriteBatch, Color.Gray, Color.Green); } if (ball.getPosY() > bot) { //ball.setPosY(60); spriteBatch.DrawString(font1, "Game Over!", new Vector2(100, 100), Color.Green); //dragonList.drawActive(spriteBatch); } //foreach (Sprite3 p in Spritewall) // p.Draw(spriteBatch); if (wl != null) { wl.Draw(spriteBatch, Color.Teal, Color.Red); } LineBatch.drawLineRectangle(spriteBatch, rectangle, Color.Gray); //draw animation //string output1 = "Socre: "; Vector2 FontOrigin1 = font1.MeasureString("a") / 2; spriteBatch.DrawString(font1, "Score " + scoure.ToString(), new Vector2(100, 100), Color.Green); //anmiation1.Draw(spriteBatch); // dragon.Draw(spriteBatch); //if(dragonList != null) dragonList.drawActive(spriteBatch); 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); spriteBatch.Begin(); back1.Draw(spriteBatch); //*** paddle.Draw(spriteBatch); //*** ball.Draw(spriteBatch); sl.Draw(spriteBatch); if (showbb) { paddle.drawBB(spriteBatch, Color.Black); paddle.drawHS(spriteBatch, Color.Green); ball.drawInfo(spriteBatch, Color.Gray, Color.Green); sl.drawInfo(spriteBatch, Color.Brown, Color.Aqua); LineBatch.drawLineRectangle(spriteBatch, playArea, Color.Blue); } spriteBatch.End(); // TODO: Add your drawing code here base.Draw(gameTime); }