Ejemplo n.º 1
0
 ////////////////////////////////////////////////////////////////////////
 ///
 /// @fn public void RecommencerPartie()
 /// @brief Recommence la partie.
 /// @return Aucune.
 ///
 ////////////////////////////////////////////////////////////////////////
 public void RecommencerPartie()
 {
     resetConfig();
     FonctionsNatives.purgeAll();
     FonctionsNatives.ouvrirXML(map, map.Capacity);
     FonctionsNatives.resetNombreBillesCourantes();
     FonctionsNatives.construireListesPalettes();
     FonctionsNatives.mettreAJourListeBillesEtNoeuds();
 }
Ejemplo n.º 2
0
 ////////////////////////////////////////////////////////////////////////
 ///
 /// @fn private void ProchainePartie()
 /// @brief Chargement de la prochaine partie.
 /// @return Aucune.
 ///
 ////////////////////////////////////////////////////////////////////////
 private void ProchainePartie()
 {
     FonctionsNatives.arreterToutSons();
     boolTemp   = false;
     peutAnimer = false;
     map        = new StringBuilder(myMaps[currentZone]);
     nextMap    = new StringBuilder(map.ToString());
     nextMap.Remove(nextMap.Length - 4, 4);
     System.Threading.Thread.Sleep(500);
     zInfo = new ZoneInfo(Path.GetFileName(nextMap.ToString()), FonctionsNatives.obtenirDifficulte(map, map.Capacity).ToString(), true);
     Program.myCustomConsole.Hide();
     this.Hide();
     zInfo.ShowDialog();
     this.Show();
     Program.myCustomConsole.Show();
     if (Program.mMenu.modeJeuMain != null)
     {
         FonctionsNatives.arreterToutSons();
         Program.myCustomConsole.Show();
         Program.mMenu.modeJeuMain.Focus();
     }
     FonctionsNatives.ouvrirXML(map, map.Capacity);
     FonctionsNatives.construireListesPalettes();
     FonctionsNatives.resetNombreDePointsDePartie();
     FonctionsNatives.resetNombreBillesCourantes();
     FonctionsNatives.mettreAJourListeBillesEtNoeuds();
     currentZone++;
     peutAnimer = true;
     boolTemp   = true;
     FonctionsNatives.bouclerSon(bgm, bgm.Length);
     FonctionsNatives.ajusterVolume(bgm, bgm.Length, 90);
     FonctionsNatives.jouerSon(bgm, bgm.Length);
     /// La création de l'état s'occupe d'appeler resetConfig
     etat = new EtatJeuDebutDePartie(this);
     // Il faut changer le mode car le traitement de début est fini
     etat           = new EtatJeuJouer(this);
     label_Nom.Text = "Nom: " + Path.GetFileNameWithoutExtension(map.ToString());
     if (nbZones == 1)
     {
         this.Text = "Partie Rapide: " + Path.GetFileNameWithoutExtension(map.ToString());
     }
     if (nbZones > 1)
     {
         this.Text = "Campagne: " + Path.GetFileNameWithoutExtension(map.ToString());
     }
 }
Ejemplo n.º 3
0
        ////////////////////////////////////////////////////////////////////////
        ///
        /// @fn private void RecommencerTout()
        /// @brief Reinitialise la campagne ou la partie rapide lorsqu'on termine.
        ///
        /// @return Aucune.
        ///
        ////////////////////////////////////////////////////////////////////////
        public void RecommencerTout()
        {
            if (gameOver.Enabled)
            {
                gameOver.Hide();
            }

            pointsPartie = 0;
            currentZone  = 0;
            map          = new StringBuilder(myMaps[0]);
            nextMap      = new StringBuilder(map.ToString());
            nextMap.Remove(nextMap.Length - 4, 4);
            Program.myCustomConsole.Hide();
            this.Hide();
            zInfo = new ZoneInfo(Path.GetFileName(nextMap.ToString()), FonctionsNatives.obtenirDifficulte(map, map.Capacity).ToString(), false);
            zInfo.ShowDialog();
            this.Show();
            if (Program.mMenu.modeJeuMain != null)
            {
                Program.myCustomConsole.Show();
                Program.mMenu.modeJeuMain.Focus();
            }
            FonctionsNatives.ouvrirXML(map, map.Capacity);
            FonctionsNatives.resetNombreDePointsDePartie();
            FonctionsNatives.resetNombreBillesCourantes();
            FonctionsNatives.construireListesPalettes();
            currentZone = 1;
            peutAnimer  = true;
            boolTemp    = true;
            FonctionsNatives.jouerSon(bgm, bgm.Length);
            /// La création de l'état s'occupe d'appeler resetConfig
            etat = new EtatJeuDebutDePartie(this);
            // Il faut changer le mode car le traitement de début est fini
            etat = new EtatJeuJouer(this);

            // gameOver.Close();
            gameOver.Dispose();
            label_Nom.Text = "Nom: " + Path.GetFileNameWithoutExtension(map.ToString());
        }
Ejemplo n.º 4
0
        ////////////////////////////////////////////////////////////////////////
        ///
        /// @fn public ModeJeu(List<string> maps, int playerType)
        /// @brief Constructeur par parametre de la fenetre de mode jeu.
        ///
        /// @param[in] maps : Liste de zones a jouer.
        /// @param[in] playerType : Type de joueur (Solo, 2P, AI)
        ///
        /// @return Aucune (constructeur).
        ///
        ////////////////////////////////////////////////////////////////////////
        public ModeJeu(List <string> maps, int playerType)
        {
            this.MouseWheel += new MouseEventHandler(panel_GL_MouseWheel);

            if (FonctionsNatives.obtenirModeDoubleBille() != 0)
            {
                nombreBillesMax = 2;
            }
            else
            {
                nombreBillesMax = 1;
            }

            // Permet d'etablir le type de joueur
            EtablirTouchesEtAI(playerType);

            this.KeyDown += new KeyEventHandler(PartieRapide_KeyDown);
            this.KeyUp   += new KeyEventHandler(PartieRapide_KeyUp);
            InitializeComponent();
            peutAnimer           = true;
            Program.peutAfficher = true;
            InitialiserAnimation();
            FonctionsNatives.resetZoom();
            currentZoom = -1;
            myMaps      = new List <string>(maps);
            nbZones     = maps.Count;
            map         = new StringBuilder(myMaps[0]);
            FonctionsNatives.ouvrirXML(map, map.Capacity);
            resetConfig();
            nombreBillesInit = FonctionsNatives.obtenirNombreDeBilles();
            FonctionsNatives.construireListesPalettes();
            FonctionsNatives.translater(-10, 0);

            currentZone++;
            Program.tempBool = true;
            panel_GL.Focus();
            string nomMap = Path.GetFileNameWithoutExtension(map.ToString());

            label_Nom.Text = "Nom: " + nomMap;
            if (nbZones == 1)
            {
                this.Text = "Partie Rapide: " + nomMap;
            }
            if (nbZones > 1)
            {
                this.Text = "Campagne: " + nomMap;
            }
            etat = new EtatJeuDebutDePartie(this);
            // Il faut changer le mode car le traitement de début est fini
            etat = new EtatJeuJouer(this);
            FonctionsNatives.animerJeu(true);

            if (true)
            {
                StringBuilder myFont = new StringBuilder("Bloodthirsty.ttf");
                // On spécifie la font
                FonctionsNatives.creeTexte(Points, Points.Capacity, myFont, myFont.Capacity);
                FonctionsNatives.creeTexte(Billes, Billes.Capacity, myFont, myFont.Capacity);

                // On specifie la taille (en 1/72 de pouce)
                FonctionsNatives.resize(Points, Points.Capacity, 35);
                FonctionsNatives.resize(Billes, Billes.Capacity, 35);

                // On specifie une couleur RGB
                FonctionsNatives.changerCouleurV(Points, Points.Capacity, ColorList.COLOR_Green);
                FonctionsNatives.changerCouleurV(Billes, Billes.Capacity, ColorList.COLOR_White);

                // On specifie la position
                FonctionsNatives.repositionner(Points, Points.Capacity, 1, 1);
                FonctionsNatives.repositionner(Billes, Billes.Capacity, 1, 1);

                // On demande d'afficher !
                FonctionsNatives.afficherTextes();
            }

            panelHeight = panel_GL.Size.Height;
            panelWidth  = panel_GL.Size.Width;


            if (Program.playerName.ToLower() == "admin")
            {
                FonctionsNatives.creeTexte(informations, informations.Capacity, fontArial, fontArial.Capacity);
                FonctionsNatives.resize(informations, informations.Capacity, 12);
                FonctionsNatives.changerCouleurV(informations, informations.Capacity, ColorList.COLOR_dark_red);
                FonctionsNatives.repositionner(informations, informations.Capacity, 0, 1);
            }

            fullscreen.EnterFullScreenMode(this);
        }