protected override void LoadContent() { piece_font = Content.Load <SpriteFont>(@"SpriteFonts\piece_font"); timer = Content.Load <SpriteFont>(@"SpriteFonts\TimerFont"); scoring = Content.Load <SpriteFont>(@"SpriteFonts\ScoringFont"); HealthBar = Content.Load <Texture2D>(@"Sprites\Hero\HealthBar"); bullet_texture = Content.Load <Texture2D>(@"SpriteFonts\Bullet_Texture"); timer_texture = Content.Load <Texture2D>(@"SpriteFonts\Timer_Text"); spriteBatch = new SpriteBatch(GraphicsDevice); Resources.LoadContent(Content); saut = Content.Load <SoundEffect>(@"Sons\Bruitages\saut_mario"); Main = new GameMain(); Main2 = new GameMain2(); Main3 = new GameMain3(); Main4 = new GameMain4(); Main5 = new GameMain5(); Main6 = new GameMain6(); MainMulti = new GameMainMulti(Global.MainMenu.ip); main = new MainMenu(this, 0f); reloading_instance = Resources.reload_sound.CreateInstance(); //Menu main.LoadContent(Content); //main.Font = Content.Load<SpriteFont>("TimerFont"); }
public MainMenu(Game1 game, float startTime) : base(game) { // Constructeur: volume_sons = 0.6f; english = false; time = startTime; started = false; paused = false; finished = false; boss_appeared = false; has_Lost = false; boss_already_appeared = false; Boss_dead_instance = Resources.boss_mort_sound.CreateInstance(); total_piece_updated = false; Text = "0"; nb_pieces = 0; mort_enemies = Resources.enemies_sound.CreateInstance(); piece_font = Resources.piece_font; piece_text = " 0"; //Ajout des boutons nécessaires Intro.Add(new GUIElement(@"Sprites\Menu\Intro\Intro2_Fond")); Intro.Add(new GUIElement(@"Sprites\Menu\Intro\Intro_Fond")); main.Add(new GUIElement(@"Sprites\Menu\English\Bouton_jouer")); main.Add(new GUIElement(@"Sprites\Menu\English\Bouton_quitter")); main.Add(new GUIElement(@"Sprites\Menu\Francais\Button_jouer")); main.Add(new GUIElement(@"Sprites\Menu\Francais\Button_options")); main.Add(new GUIElement(@"Sprites\Menu\Francais\Button_quitter")); main.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_Credits")); InOptions.Add(new GUIElement(@"Sprites\Menu\English\Bouton_Bruitages")); InOptions.Add(new GUIElement(@"Sprites\Menu\Francais\Desinstaller")); InOptions.Add(new GUIElement(@"Sprites\Menu\English\Uninstall")); InOptions.Add(new GUIElement(@"Sprites\Menu\English\Bouton_Retour")); InOptions.Add(new GUIElement(@"Sprites\Menu\English\Bouton_PleinEcran")); InOptions.Add(new GUIElement(@"Sprites\Menu\English\Bouton_Commandes")); InOptions.Add(new GUIElement(@"Sprites\Menu\English\Bouton_French")); InOptions.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_Retour")); InOptions.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_Volume")); InOptions.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_Plus")); InOptions.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_Moins")); InOptions.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_Bruitages")); InOptions.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_Plus2")); InOptions.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_Moins2")); InOptions.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_Commandes")); InOptions.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_PleinEcran")); InOptions.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_Anglais")); InOptions.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_Website")); InOptions.Add(new GUIElement(@"Sprites\Menu\English\Bouton_Website")); InPause.Add(new GUIElement(@"Sprites\Menu\English\Bouton_Continuer")); InPause.Add(new GUIElement(@"Sprites\Menu\English\Bouton_quitter")); InPause.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_Continuer")); InPause.Add(new GUIElement(@"Sprites\Menu\Francais\Button_options")); InPause.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_MenuPrincipalGros")); InPause.Add(new GUIElement(@"Sprites\Menu\Francais\Button_quitter")); HowToPlay.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_RetourToOptions")); HowToPlay.Add(new GUIElement(@"Sprites\Menu\English\Bouton_RetourToOptions")); SelectionMap.Add(new GUIElement(@"Sprites\Menu\English\Bouton_NouvellePartie")); SelectionMap.Add(new GUIElement(@"Sprites\Menu\English\Bouton_Multijoueur")); SelectionMap.Add(new GUIElement(@"Sprites\Menu\English\Bouton_Retour")); SelectionMap.Add(new GUIElement(@"Sprites\Menu\English\Bouton_Chapitres")); SelectionMap.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_NouvellePartie")); SelectionMap.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_Multijoueur")); SelectionMap.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_Retour")); SelectionMap.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_Chapitres")); GameOver.Add(new GUIElement(@"Sprites\Menu\Francais\Boutton_Rejouer")); GameOver.Add(new GUIElement(@"Sprites\Menu\English\Boutton_Rejouer")); GameOver.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_MenuPrincipal")); Credits.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_Retour")); Credits.Add(new GUIElement(@"Sprites\Menu\English\Bouton_Retour")); Won.Add(new GUIElement(@"Sprites\Menu\English\Bouton_NiveauSuivant")); Won.Add(new GUIElement(@"Sprites\Menu\English\Boutton_Rejouer")); Won.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_NiveauSuivant")); Won.Add(new GUIElement(@"Sprites\Menu\Francais\Boutton_Rejouer")); Won.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_MenuPrincipal")); GameEnded.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_Credits")); GameEnded.Add(new GUIElement(@"Sprites\Menu\Francais\Boutton_Rejouer")); GameEnded.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_MenuPrincipal")); GameEnded.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_Boutique")); Chapitre1.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_RetourToJouer")); Chapitre1.Add(new GUIElement(@"Sprites\Menu\Francais\Level1")); Chapitre1.Add(new GUIElement(@"Sprites\Menu\Francais\fleche_droite")); Chapitre1.Add(new GUIElement(@"Sprites\Menu\English\Bouton_RetourToJouer")); Chapitre2.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_RetourToJouer")); Chapitre2.Add(new GUIElement(@"Sprites\Menu\Francais\Level2")); Chapitre2.Add(new GUIElement(@"Sprites\Menu\Francais\fleche_droite2")); Chapitre2.Add(new GUIElement(@"Sprites\Menu\Francais\fleche_gauche")); Chapitre2.Add(new GUIElement(@"Sprites\Menu\English\Bouton_RetourToJouer")); Chapitre3.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_RetourToJouer")); Chapitre3.Add(new GUIElement(@"Sprites\Menu\Francais\Level3")); Chapitre3.Add(new GUIElement(@"Sprites\Menu\Francais\fleche_droite3")); Chapitre3.Add(new GUIElement(@"Sprites\Menu\Francais\fleche_gauche2")); Chapitre3.Add(new GUIElement(@"Sprites\Menu\English\Bouton_RetourToJouer")); Chapitre4.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_RetourToJouer")); Chapitre4.Add(new GUIElement(@"Sprites\Menu\Francais\Level4")); Chapitre4.Add(new GUIElement(@"Sprites\Menu\Francais\fleche_droite4")); Chapitre4.Add(new GUIElement(@"Sprites\Menu\Francais\fleche_gauche3")); Chapitre4.Add(new GUIElement(@"Sprites\Menu\English\Bouton_RetourToJouer")); Chapitre5.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_RetourToJouer")); Chapitre5.Add(new GUIElement(@"Sprites\Menu\Francais\Level5")); Chapitre5.Add(new GUIElement(@"Sprites\Menu\Francais\fleche_droite5")); Chapitre5.Add(new GUIElement(@"Sprites\Menu\Francais\fleche_gauche4")); Chapitre5.Add(new GUIElement(@"Sprites\Menu\English\Bouton_RetourToJouer")); Chapitre6.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_RetourToJouer")); Chapitre6.Add(new GUIElement(@"Sprites\Menu\Francais\Level6")); Chapitre6.Add(new GUIElement(@"Sprites\Menu\Francais\fleche_gauche5")); Chapitre6.Add(new GUIElement(@"Sprites\Menu\English\Bouton_RetourToJouer")); player1win.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_MenuPrincipal")); player2win.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_MenuPrincipal")); ChooseIp.Add(new GUIElement(@"Sprites\Menu\Francais\Bouton_RetourToJouer")); ChooseIp.Add(new GUIElement(@"Sprites\Menu\Francais\EnterIp")); ChooseIp.Add(new GUIElement(@"Sprites\Menu\Francais\Ok")); ip = ""; player = Global.Player; player2 = Global.Player; player3 = Global.Player; player4 = Global.Player; player5 = Global.Player; player6 = Global.Player; p7 = Global.Player; p8 = Global.Player; Main = Global.GameMain; Main2 = Global.GameMain2; Main3 = Global.GameMain3; Main4 = Global.GameMain4; Main5 = Global.GameMain5; Main6 = Global.GameMain6; MainMulti = Global.GameMainMulti; Global.MainMenu = this; }
public void CreateGame(int i) { total_piece_updated = false; enjeu = true; has_Lost = false; score = 300; nb_pieces = 0; time = 0f; enemies_dead = 0; Global.Handler.ammo_left = 6; Global.Handler.recharge_left = 30; MediaPlayer.IsRepeating = true; HasPlayed = true; switch (i) { case 1: gameState = GameState.InGame; MediaPlayer.Play(Resources.MusiqueMain); Main = new GameMain(); player = new Player(); enemies = Global.GameMain.enemies; enemies2 = Global.GameMain.enemies2; break; case 2: gameState = GameState.InGame2; MediaPlayer.Play(Resources.Musique2); Main2 = new GameMain2(); player2 = new Player(); enemies = Global.GameMain2.enemies; enemies2 = Global.GameMain2.enemies2; break; case 3: gameState = GameState.InGame3; MediaPlayer.Play(Resources.Musique3); Main3 = new GameMain3(); player3 = new Player(); enemies = Global.GameMain3.enemies; enemies2 = Global.GameMain3.enemies2; break; case 4: gameState = GameState.InGame4; MediaPlayer.Play(Resources.Musique4); Main4 = new GameMain4(); player4 = new Player(); enemies = Global.GameMain4.enemies; enemies2 = Global.GameMain4.enemies2; break; case 5: gameState = GameState.InGame5; MediaPlayer.Play(Resources.Musique5); Main5 = new GameMain5(); player5 = new Player(); enemies = Global.GameMain5.enemies; enemies2 = Global.GameMain5.enemies2; break; case 6: gameState = GameState.InGame6; MediaPlayer.Play(Resources.Musique6); Main6 = new GameMain6(); player6 = new Player(); enemies = Global.GameMain6.enemies; enemies2 = Global.GameMain6.enemies2; break; case 7: gameState = GameState.InGameMulti; MediaPlayer.Play(Resources.Musique3); MainMulti = new GameMainMulti(ip); p7 = new Player(); p8 = new Player(); break; } }
protected override void LoadContent() { piece_font = Content.Load<SpriteFont>(@"SpriteFonts\piece_font"); timer = Content.Load<SpriteFont>(@"SpriteFonts\TimerFont"); scoring = Content.Load<SpriteFont>(@"SpriteFonts\ScoringFont"); HealthBar = Content.Load<Texture2D>(@"Sprites\Hero\HealthBar"); bullet_texture = Content.Load<Texture2D>(@"SpriteFonts\Bullet_Texture"); timer_texture = Content.Load<Texture2D>(@"SpriteFonts\Timer_Text"); spriteBatch = new SpriteBatch(GraphicsDevice); Resources.LoadContent(Content); saut = Content.Load<SoundEffect>(@"Sons\Bruitages\saut_mario"); Main = new GameMain(); Main2 = new GameMain2(); Main3 = new GameMain3(); Main4 = new GameMain4(); Main5 = new GameMain5(); Main6 = new GameMain6(); MainMulti = new GameMainMulti(Global.MainMenu.ip); main = new MainMenu(this, 0f); reloading_instance = Resources.reload_sound.CreateInstance(); //Menu main.LoadContent(Content); //main.Font = Content.Load<SpriteFont>("TimerFont"); }