Example #1
0
        public Info_Intro(string name, Vector2 position, bool is_red, GameScreen screen, SpriteFont font)
        {
            _name     = name;
            _position = position;
            _is_red   = is_red;
            _font     = font;
            _screen   = screen;

            _timer = new Compteur_Time(_temps_annimation_in);
        }
Example #2
0
        public override void HandleInput(InputState input)
        {
            foreach (GestureSample gesture in input.Gestures)
            {
                if (gesture.GestureType == GestureType.Tap)
                {
                    if (gesture.Position.X > 0 &&
                        gesture.Position.Y > 0 &&
                        gesture.Position.X < width &&
                        gesture.Position.Y < height)
                    {
                        switch (_statut_tuto)
                        {
                        case Statut_Annimation_Page.Page_1:
                            time         = new Compteur_Time(2000f);
                            _statut_tuto = Statut_Annimation_Page.Page_2;
                            _phase_anim  = Phase_Annimation.Phase_1;
                            plateau.Changement_Statut_Case_To_Selected(0);
                            plateau.Changement_Statut_Selected_To_Validation(1, 0, CaseClass.Type_Case.Red);
                            break;

                        case Statut_Annimation_Page.Page_2:
                            _statut_tuto = Statut_Annimation_Page.Page_3;
                            _phase_anim  = Phase_Annimation.Phase_1;
                            plateau.Reset_Plateau("333333333333333300000000444444444444444444444444");
                            plateau.Changement_Statut_Case_To_Selected(11);
                            plateau.Changement_Statut_Selected_To_Validation(19, 11, CaseClass.Type_Case.Red);
                            break;

                        case Statut_Annimation_Page.Page_3:
                            _statut_tuto = Statut_Annimation_Page.Page_4;
                            _phase_anim  = Phase_Annimation.Phase_1;
                            break;

                        case Statut_Annimation_Page.Page_4:
                            this.ExitScreen();
                            ScreenManager.AddScreen(new MainMenuScreen());
                            break;

                        default:
                            this.ExitScreen();
                            ScreenManager.AddScreen(new MainMenuScreen());
                            break;
                        }
                    }
                }
            }
            base.HandleInput(input);
        }
Example #3
0
        private void LoadContent()
        {
            width  = _screen.ScreenManager.GraphicsDevice.Viewport.Width;
            height = _screen.ScreenManager.GraphicsDevice.Viewport.Height;

            _r      = new Rectangle(0, 0, (int)(width / 2), height);
            red_t   = rectangle.Texture_Rounded_Rectangle(_screen.ScreenManager.GraphicsDevice, (int)(width * 0.75), (int)(height * 2), color_red, 0, 0);
            green_t = rectangle.Texture_Rounded_Rectangle(_screen.ScreenManager.GraphicsDevice, (int)(width * .75), (int)_r.Height, color_green, 0, 0);

            font_manage = new Police_Size_Manage(height, width, _screen);
            font_bold   = font_manage.Get_Regular_Font();
            font_35     = font_manage.Get_Bold_Gros2_Font();


            _timer_fade_out      = new Compteur_Time(_temps_Finish_Fade_Out - _temps_Fade_Out_Player);
            _timer_fade_out_fond = new Compteur_Time(_temps_End - _temps_Finish_Fade_Out);

            bool _add_deja_fait = false;

            if (_data [2] != null && _data [2] != "")
            {
                string fin_string = _data [2].Substring(_data [2].Length - 3, 3);
                if (fin_string == "pts")
                {
                    _add_deja_fait = true;
                }
            }
            else if (_data [5] != null && _data [5] != "")
            {
                string fin_string = _data [5].Substring(_data [5].Length - 3, 3);
                if (fin_string == "pts")
                {
                    _add_deja_fait = true;
                }
            }

            if (!_add_deja_fait)
            {
                if (langue.lang == "FR")
                {
                    if (_data [1] != "")
                    {
                        if (_data [1] == "1")
                        {
                            _data [1] = _data [1] + "er";
                        }
                        else
                        {
                            _data [1] = _data [1] + "ème";
                        }
                    }

                    if (_data [4] != "")
                    {
                        if (_data [4] == "1")
                        {
                            _data [4] = _data [4] + "er";
                        }
                        else
                        {
                            _data [4] = _data [4] + "ème";
                        }
                    }
                }
                else
                {
                    if (_data [1] != "")
                    {
                        if (_data [1] == "1")
                        {
                            _data [1] = _data [1] + "st";
                        }
                        else if (_data [1] == "2")
                        {
                            _data [1] = _data [1] + "nd";
                        }
                        else
                        {
                            _data [1] = _data [1] + "th";
                        }
                    }

                    if (_data [4] != "")
                    {
                        if (_data [4] == "1")
                        {
                            _data [4] = _data [4] + "st";
                        }
                        else if (_data [4] == "2")
                        {
                            _data [4] = _data [4] + "nd";
                        }
                        else
                        {
                            _data [4] = _data [4] + "th";
                        }
                    }
                }

                if (_data [2] != "")
                {
                    _data [2] = _data [2] + "pts";
                }
                if (_data [5] != "")
                {
                    _data [5] = _data [5] + "pts";
                }
            }

            _red_name = new Info_Intro(_data[0], new Vector2((float)(0 - font_bold.MeasureString(_data[0]).X *font_manage._scale), (float)(height * 0.2)), true, _screen, font_bold);
            _red_rank = new Info_Intro(_data[1], new Vector2((float)(0 - font_bold.MeasureString(_data[1]).X *font_manage._scale), (float)(height * 0.25)), true, _screen, font_bold);
            _red_elo  = new Info_Intro(_data[2], new Vector2((float)(0 - font_bold.MeasureString(_data[2]).X *font_manage._scale), (float)(height * 0.3)), true, _screen, font_bold);

            _green_name = new Info_Intro(_data[3], new Vector2((float)(width), (float)(height * 0.7)), false, _screen, font_bold);
            _green_rank = new Info_Intro(_data[4], new Vector2((float)(width), (float)(height * 0.75)), false, _screen, font_bold);
            _green_elo  = new Info_Intro(_data[5], new Vector2((float)(width), (float)(height * 0.8)), false, _screen, font_bold);

            _position_destination_X_red   = (float)(width * 0.1);
            _position_destination_X_green = (float)(width * 0.65);
        }
Example #4
0
        void Annim(float timer)
        {
            if (_annim_red || _annim_green)
            {
                if (annim_statut == Annimation.Attente)
                {
                    annim_statut      = Annimation.Phase_1;
                    _timer_annimation = new Compteur_Time(700f);
                }
                else if (annim_statut == Annimation.Phase_1)
                {
                    if (_timer_annimation.IncreaseTimer(timer))
                    {
                        if (_annim_red)
                        {
                            red   = new Rectangle(0, 0, width, height);
                            green = new Rectangle(0, 0, 0, 0);
                            black = new Rectangle(0, 0, 0, 0);
                        }
                        else
                        {
                            green = new Rectangle(0, 0, width, height);
                            red   = new Rectangle(0, 0, 0, 0);
                            black = new Rectangle(0, 0, 0, 0);
                        }
                        annim_statut      = Annimation.Phase_2;
                        _timer_annimation = new Compteur_Time(500f);
                    }
                    else
                    {
                        if (_annim_red)
                        {
                            red.Width = (int)((width / 2) + (_timer_annimation._timer / _timer_annimation._timer_max * (width / 2)));
                        }
                        else
                        {
                            green.Width = (int)((width / 2) + (_timer_annimation._timer / _timer_annimation._timer_max * (width / 2)));
                            green.X     = (int)((width / 2) - (_timer_annimation._timer / _timer_annimation._timer_max * (width / 2)));
                        }

                        _alpha_texte = 1 - (_timer_annimation._timer / (_timer_annimation._timer_max / 2));
                    }
                }
                else if (annim_statut == Annimation.Phase_2)
                {
                    if (_timer_annimation.IncreaseTimer(timer))
                    {
                        annim_statut      = Annimation.Phase_3;
                        _timer_annimation = new Compteur_Time(1500f);
                    }
                    else
                    {
                        _alpha_texte = _timer_annimation._timer * _timer_annimation._timer_max;
                    }
                }
                else if (annim_statut == Annimation.Phase_3)
                {
                    if (_timer_annimation.IncreaseTimer(timer))
                    {
                        _timer_annimation = new Compteur_Time(1000f);
                        Side_Choose();
                    }
                }
            }
        }
Example #5
0
 public TransitionClass()
 {
     _statut = Statut_Transition.On;
     time    = new Compteur_Time(_timer_max);
 }