public void DrawGame() { mHero.Draw(); foreach (BasketBall b in mBBallList) { b.Draw(); } if (null != mFinal) { mFinal.Draw(); } // Drawn last to always show up on top FontSupport.PrintStatus("Status: " + "Score=" + mScore + " Basketball: Generated( " + mTotalBBallCreated + ") Collected(" + mBBallHit + ") Missed(" + mBBallMissed + ")", null); }
/// <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) { // Clear to background color GraphicsDevice.Clear(Color.CornflowerBlue); Game1.sSpriteBatch.Begin(); // Initialize drawing support //mSpriteBatch.Begin(); // Initialize drawing support // Loop over and draw each primitive /*foreach (TexturedPrimitive p in mGraphicsObjects) * { * p.Draw(); * }*/ // Print out text message to echo status /*FontSupport.PrintStatus("Selected object is:" + mCurrentIndex + * " Location=" + mGraphicsObjects[mCurrentIndex].GetMPosition(), null); * FontSupport.PrintStatusAt(mGraphicsObjects[mCurrentIndex].GetMPosition(), "Selected", * Color.Red); * mUWBLogo.Draw(); * mBall.Draw();*/ // Print out text message to echo status /*FontSupport.PrintStatus("Ball Position:" + mBall.GetMPosition(), null); * FontSupport.PrintStatusAt(mUWBLogo.GetMPosition(), * mUWBLogo.GetMPosition().ToString(), Color.White); * FontSupport.PrintStatusAt(mBall.GetMPosition(), "Radius" + mBall.Radius, Color.Red);*/ //mTheGame.DrawGame(); switch (nivelAtual) { case 1: Game1.sSpriteBatch.Draw(levels[5], new Rectangle(0, 0, 800, 800), Color.LightBlue); FontSupport.PrintStatusAt(new Vector2(10, 95), "Game by Paulo Sergio Nunes Naressi", null); FontSupport.PrintStatusAt(new Vector2(15, 80), "Use the Left and Right buttons to move the stick.", null); FontSupport.PrintStatusAt(new Vector2(15, 75), "Break all the blocks in a level to advance!", null); FontSupport.PrintStatusAt(new Vector2(45, 65), "BLOCK BREAKER IPCA", null); FontSupport.PrintStatusAt(new Vector2(45, 25), "PRESS ENTER TO BEGIN", null); break; case 2: Game1.sSpriteBatch.Draw(levels[5], new Rectangle(0, 0, 800, 800), Color.Yellow); FontSupport.PrintStatusAt(new Vector2(15, 80), "CONGRATULATIONS!!!", null); FontSupport.PrintStatusAt(new Vector2(15, 75), "Final Score: " + score, null); //FontSupport.PrintStatusAt(new Vector2(15, 70), "Press Enter to return to the Title Screen.", null); break; case 3: Game1.sSpriteBatch.Draw(levels[5], new Rectangle(0, 0, 800, 800), Color.Gray); FontSupport.PrintStatusAt(new Vector2(15, 80), "GAME OVER...", null); FontSupport.PrintStatusAt(new Vector2(15, 75), "Final Score: " + score, null); //FontSupport.PrintStatusAt(new Vector2(15, 70), "Press Enter to return to the Title Screen.", null); break; case 4: Game1.sSpriteBatch.Draw(levels[0], new Rectangle(0, 0, 800, 800), Color.White); mBastao.Draw(); mEsfera.Draw(); //mBloco.Draw2(); for (int i = 0; i < 40; i++) { mBlocoAzulNivel1[i].Draw2(); } break; case 5: Game1.sSpriteBatch.Draw(levels[1], new Rectangle(0, 0, 800, 800), Color.White); mBastao.Draw(); mEsfera.Draw(); for (int i = 0; i < 10; i++) { mBlocoAmareloNivel2[i].Draw2(); mBlocoAmareloQuebradoNivel2[i].Draw2(); } for (int i = 0; i < 20; i++) { mBlocoAzulNivel2[i].Draw2(); } break; case 6: Game1.sSpriteBatch.Draw(levels[2], new Rectangle(0, 0, 800, 800), Color.White); mBastao.Draw(); mEsfera.Draw(); for (int i = 0; i < 20; i++) { mBlocoAmareloNivel3[i].Draw2(); mBlocoAmareloQuebradoNivel3[i].Draw2(); mBlocoAzulNivel3[i].Draw2(); } break; case 7: Game1.sSpriteBatch.Draw(levels[3], new Rectangle(0, 0, 800, 800), Color.White); mBastao.Draw(); mEsfera.Draw(); for (int i = 0; i < 4; i++) { mBlocoMarromNivel4[i].Draw2(); mBlocoMarromQuebradoNivel4[i].Draw2(); mBlocoMarromQuebrado2Nivel4[i].Draw2(); } for (int i = 0; i < 10; i++) { mBlocoAmareloNivel4[i].Draw2(); mBlocoAmareloQuebradoNivel4[i].Draw2(); } for (int i = 0; i < 18; i++) { mBlocoAzulNivel4[i].Draw2(); } break; case 8: Game1.sSpriteBatch.Draw(levels[4], new Rectangle(0, 0, 800, 800), Color.White); for (int i = 0; i < 4; i++) { mBlocoVermelhoNivel5[i].Draw2(); mBlocoVermelhoQuebradoNivel5[i].Draw2(); mBlocoVermelhoQuebrado2Nivel5[i].Draw2(); mBlocoVermelhoQuebrado3Nivel5[i].Draw2(); } for (int i = 0; i < 28; i++) { mBlocoMarromNivel5[i].Draw2(); mBlocoMarromQuebradoNivel5[i].Draw2(); mBlocoMarromQuebrado2Nivel5[i].Draw2(); } for (int i = 0; i < 10; i++) { mBlocoAmareloNivel5[i].Draw2(); mBlocoAmareloQuebradoNivel5[i].Draw2(); } for (int i = 0; i < 10; i++) { mBlocoAzulNivel5[i].Draw2(); } mBastao.Draw(); mEsfera.Draw(); break; } if (nivelAtual > 3) { for (int i = 0; i < vida; i++) { placarVida[i].Draw(); } FontSupport.PrintStatusAt(new Vector2(93, 95), "Score: " + score, null); if (nivelAtual == 8) { FontSupport.PrintStatusAt(new Vector2(93, 93), "Stage: FINAL", null); } else { FontSupport.PrintStatusAt(new Vector2(93, 93), "Stage: " + (nivelAtual - 3), null); } } Game1.sSpriteBatch.End(); // Inform graphics system we are done drawing // Draw the JPGImage //mSpriteBatch.Draw(mJPGImage, mJPGPosition, Color.White); // Draw the PNGImage //mSpriteBatch.Draw(mPNGImage, mPNGPosition, Color.White); //mSpriteBatch.End(); // Inform graphics system we are done drawing // TODO: Add your drawing code here base.Draw(gameTime); }