public override void Draw(GameTime gametime, SpriteBatch g) { g.End(); g.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, Camera.Transform); g.GraphicsDevice.Clear(Color.Black); //Si Pause if (Paused) { g.GraphicsDevice.Clear(Color.White); g.Draw(pausedTexture, pausedrectangle, Color.White); btnPlay.Draw(g); btnQuit.Draw(g); } else { Player.Draw(gametime, g); foreach (ObjCollisionable Object in Obstacles) { Object.Draw(g); } BarreVie.Draw(g); EnnemiePatrol.Draw(gametime, g); } // Scrolling1.Draw(g); }
public override void Draw(GameTime gametime, SpriteBatch g) { Joueur.Draw(gametime, g); foreach (ObjCollisionable muret in Mur) { muret.Draw(g); } foreach (EnemyPatrol Ennemie in EnnemiesPatrols) { Ennemie.Draw(gametime, g); } switch (CurrentEmplacement) { #region outBase case Emplacement.outbase: switch (SideofOutBase) { case EmplacementoutBase.frontside: g.Draw(GameResources.BunkerUpperView, new Rectangle(0, 0, 800, 500), Color.White); g.Draw(GameResources.Donald, new Vector2(450, 200), Color.White); Animationplayer.Draw(gametime, g, new Vector2(350, 250), SpriteEffects.None); Animationplayer.Draw(gametime, g, new Vector2(450, 250), SpriteEffects.FlipHorizontally); Animationplayer.Draw(gametime, g, new Vector2(30, 150), SpriteEffects.None); Animationplayer.Draw(gametime, g, new Vector2(600, 200), SpriteEffects.None); Animationplayer.Draw(gametime, g, new Vector2(600, 100), SpriteEffects.FlipHorizontally); g.Draw(GameResources.BulleParole, new Vector2(200, 350), Color.White); g.DrawString(GameResources.Texte2, Parole, new Vector2(220, 380), Color.Blue); if (RetourAFront == 2) { g.Draw(GameResources.Cercle, new Rectangle(135, 245, 80, 80), Color.White); g.DrawString(GameResources.Texte, "APPUYER SUR ESPACE", new Vector2(220, 280), Color.Red); } else { g.Draw(GameResources.Test, rFlecheDroite, Color.White); g.Draw(GameResources.Test, rFlecheGauche, Color.White); g.Draw(GameResources.Fleche, rFlecheDroite, Color.Blue); g.Draw(GameResources.Fleche, rFlecheGauche, null, Color.Red, 0f, new Vector2(), SpriteEffects.FlipHorizontally, 0f); } break; case EmplacementoutBase.leftside: g.Draw(GameResources.BunkerLeftSide, new Rectangle(0, 0, 800, 500), Color.White); g.Draw(GameResources.Test, rFlecheDroite, Color.White); g.Draw(GameResources.Fleche, rFlecheDroite, Color.Blue); EnnemiPatrouille1.Draw(gametime, g); break; case EmplacementoutBase.rightside: g.Draw(GameResources.BunkerRightSide, new Rectangle(0, 0, 800, 500), Color.White); g.Draw(GameResources.Test, rFlecheGauche, Color.White); g.Draw(GameResources.Fleche, rFlecheGauche, null, Color.Red, 0f, new Vector2(), SpriteEffects.FlipHorizontally, 0f); EnnemiPatrouille2.Draw(gametime, g); break; } g.DrawString(GameResources.Texte, "A Pour Aller à gauche et D pour aller à droite", new Vector2(50, 10), Color.White); break; #endregion #region InBase case Emplacement.inBase: Joueur.Draw(gametime, g); g.DrawString(GameResources.Texte2, "JAUGE DE\nDÉTECTION", new Vector2(10, 10), Color.Blue); foreach (ObjCollisionable muret in Mur) { muret.Draw(g); } switch (PartofInBase) { case EmplacementInBase.A: g.GraphicsDevice.Clear(Color.DarkOrange); g.Draw(GameResources.Test, rDestinationb, Color.White); g.DrawString(GameResources.Texte, "PARTIE \n A", new Vector2(100, 150), Color.Blue); g.DrawString(GameResources.Texte2, "Partie \n Suivante", new Vector2(rDestinationb.X + 40, rDestinationb.Y + 40), Color.Blue); break; case EmplacementInBase.B: g.GraphicsDevice.Clear(Color.IndianRed); g.Draw(GameResources.Test, rDestinationc, Color.White); g.DrawString(GameResources.Texte, "PARTIE \n B", new Vector2(200, 220), Color.Blue); g.DrawString(GameResources.Texte2, "Partie \n Suivante", new Vector2(rDestinationc.X + 40, rDestinationc.Y + 40), Color.Blue); break; case EmplacementInBase.C: g.GraphicsDevice.Clear(Color.DarkGray); g.Draw(GameResources.Test, rDestinationd, Color.White); g.DrawString(GameResources.Texte, "PARTIE \n C", new Vector2(600, 220), Color.Blue); g.DrawString(GameResources.Texte2, "Partie Suivante", new Vector2(rDestinationd.X + 10, rDestinationd.Y + 10), Color.Blue); break; } break; #endregion #region ExplicationNiv1 case Emplacement.ExplicationNiv1: g.GraphicsDevice.Clear(Color.Black); g.DrawString(GameResources.Texte, Parole, new Vector2(), Color.Red); break; #endregion } if (BarreDeDetection != null) { BarreDeDetection.Draw(g); } }