コード例 #1
0
ファイル: Game1.cs プロジェクト: Paulalex85/ColorGame
 private void AfterSplashScreen()
 {
     screenManager.AddScreen(new BackgroundMenuScreen());
     screenManager.AddScreen(new MainMenuScreen());
     song = new Song_Management(this.screenManager);
     song.Change_Intro();
 }
コード例 #2
0
ファイル: Element_mode.cs プロジェクト: Paulalex85/ColorGame
        public override void Update(Microsoft.Xna.Framework.GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
            {
                this.ExitScreen();
                ScreenManager.AddScreen(new BackgroundMenuScreen());
                ScreenManager.AddScreen(new MainMenuScreen());
                song = new Song_Management(this.ScreenManager);
                song.Change_Intro();
            }

            song.UpdateSong();

            float timer = (float)gameTime.ElapsedGameTime.TotalMilliseconds;

            if (_initialization_done && _statut_partie == Statut_Partie.En_cours)
            {
                GestionDesEvenementsDuree(timer);

                Update_Liste_Carre_Par_Element(timer);

                objectif_ligne_carre.UpdatePosition();

                Gagner_Perdu(timer);

                _time_montre += timer;

                GestionAnnimationColorInterface(timer);

                CarreUpdate(timer);
                UpdateParticule();
                UpdateBackground(timer);
                AnnimColor();
                GestionHighScore();
                REPOSIOTNEMENTMESCOUILLES();
            }
            else if (_initialization_done && _statut_partie == Statut_Partie.Initialization)
            {
                Update_Liste_Carre_Par_Element(timer);
                Statut_partie_initialization(timer);
                UpdateParticule();
            }
            else if (_statut_partie == Statut_Partie.Pause)
            {
                pause.UpdatePause();
                Statut_sortie_de_pause();
            }
            else if (_statut_partie == Statut_Partie.Perdu)
            {
                fin_partie.Update(timer);
            }
            else if (_statut_partie == Statut_Partie.Tuto)
            {
                _tuto.UpdatePause();
                Statut_sortie_de_pause();
            }

            base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);
        }
コード例 #3
0
 private void Quitter()
 {
     _screen.ExitScreen();
     _screen.ScreenManager.AddScreen(new BackgroundMenuScreen());
     _screen.ScreenManager.AddScreen(new MainMenuScreen());
     song = new Song_Management(_screen.ScreenManager);
     song.Change_Intro();
 }
コード例 #4
0
 void Jouer8(object sender, EventArgs e)
 {
     foreach (GameScreen screen in ScreenManager.GetScreens())
     {
         screen.ExitScreen();
     }
     TransitionScreen.Load(ScreenManager, this, true, PlayerIndex.One, new Element_mode(8));
     song = new Song_Management(this.ScreenManager);
     song.Change_Ingame();
 }
コード例 #5
0
ファイル: Element_mode.cs プロジェクト: Paulalex85/ColorGame
        public override void LoadContent()
        {
            string[] k = temps_best.Split(new char[] { '-' });
            scores = new float[k.Length];
            for (int i = 0; i < k.Length; i++)
            {
                scores[i] = float.Parse(k[i]);
            }

            song       = new Song_Management(this.ScreenManager);
            background = new Background_Ingame(this, _nombre_carre);
            if (temps_best == "0")
            {
                _tuto          = new Tuto(this);
                _statut_partie = Statut_Partie.Tuto;
            }

            langue = ScreenManager.Game.Content.Load <Langues>(lang.path);
            InitilizeLanguages();

            font_evenement = ScreenManager.Game.Content.Load <SpriteFont>("menufont");

            _color_texte = Color.White;

            _nombre_de_objectif_effectue = 0;

            liste_color = new List <Color>()
            {
                new Color(32, 211, 220),
                new Color(204, 29, 29),
                new Color(254, 217, 6),
                new Color(24, 171, 31),
                new Color(255, 78, 17),
                new Color(255, 255, 255),
                new Color(255, 89, 234),
                new Color(23, 68, 243),
                new Color(145, 0, 145)
            };

            Initialize_Carre();

            Initialize_Objectif();

            _eve_3 = true;
            EvenementTexteInitializationTEMPS();

            _initialization_done = true;

            base.LoadContent();
        }
コード例 #6
0
        public override void LoadContent()
        {
            if (content == null)
            {
                content = new ContentManager(ScreenManager.Game.Services, "Content");
            }
            langue = ScreenManager.Game.Content.Load <Langues>(lang.path);
            InitilizeLanguages();

            song = new Song_Management(this.ScreenManager);

            font = ScreenManager.Game.Content.Load <SpriteFont>("menu_credit");

            base.LoadContent();
        }
コード例 #7
0
        public void HandleInput(InputState input)
        {
            Vector2 son_pos = new Vector2(10, 720);

            foreach (GestureSample gesture in input.Gestures)
            {
                if (gesture.GestureType == GestureType.Tap)
                {
                    if (gesture.Position.X > position1.X &&
                        gesture.Position.X < position1.X + font.MeasureString(reprendre.ToUpper()).X&&
                        gesture.Position.Y > position1.Y &&
                        gesture.Position.Y < position1.Y + font.MeasureString(reprendre.ToUpper()).Y)
                    {
                        Reprendre();
                    }
                    if (gesture.Position.X > position2.X &&
                        gesture.Position.X < position2.X + font.MeasureString(quitter.ToUpper()).X&&
                        gesture.Position.Y > position2.Y &&
                        gesture.Position.Y < position2.Y + font.MeasureString(quitter.ToUpper()).Y)
                    {
                        foreach (GameScreen screen in _screen.ScreenManager.GetScreens())
                        {
                            screen.ExitScreen();
                        }
                        _screen.ScreenManager.AddScreen(new BackgroundMenuScreen());
                        _screen.ScreenManager.AddScreen(new MainMenuScreen());
                        song = new Song_Management(_screen.ScreenManager);
                        song.Change_Intro();
                    }
                    if (gesture.Position.X > son_pos.X &&
                        gesture.Position.X < son_pos.X + 150 &&
                        gesture.Position.Y > son_pos.Y &&
                        gesture.Position.Y < son_pos.Y + 100)
                    {
                        song.Change_Mute();
                        if (music)
                        {
                            music = false;
                        }
                        else
                        {
                            music = true;
                        }
                    }
                }
            }
        }
コード例 #8
0
        public void Initialize()
        {
            if (music_int == "1")
            {
                music = true;
            }
            else
            {
                music = false;
            }

            song   = new Song_Management(_screen.ScreenManager);
            langue = _screen.ScreenManager.Game.Content.Load <Langues>(lang.path);
            InitilizeLanguages();
            font    = _screen.ScreenManager.Game.Content.Load <SpriteFont>("menufont");
            son     = _screen.ScreenManager.Game.Content.Load <Texture2D>("Image/son_base");
            son_on  = _screen.ScreenManager.Game.Content.Load <Texture2D>("Image/son_on");
            son_off = _screen.ScreenManager.Game.Content.Load <Texture2D>("Image/son_off");

            position1 = new Vector2(480 / 2 - font.MeasureString(reprendre.ToUpper()).X / 2, 300);
            position2 = new Vector2(480 / 2 - font.MeasureString(quitter.ToUpper()).X / 2, 450);
        }