Example #1
0
        public GameMain()
        {
            this.LoadMap();

            //// Création Joueur + Carte
            MyMap = new Map(1200, 480);
            statut_player = false;
            LocalJekyll = new Jekyll(50, 100);
            LocalHide = new Hide(50, 100);
        }
Example #2
0
        public GameMain()
        {
            this.LoadMap();

            //// Création Joueur + Carte
            MyMap = new Map(5100, 1000);
            statut_player = false;
            if (!FirstGame.checkpoint)
            {
                LocalJekyll = new Jekyll(115, 500);
                LocalHide = new Hide(115, 500);
            }
            else
            {
                LocalJekyll = new Jekyll(FirstGame.W/2-72, 100);
                LocalHide = new Hide(FirstGame.W-72 / 2, 100);
            }
            MyMap.SlideY(1000-FirstGame.H+72);
            Status = "on";
        }
Example #3
0
        public void Update(GamePadState pad, Jekyll jekyll, Hide hide)
        {
            this._jbias = Jekyll._jskillsPoints;
            this._hbias = Hide._hskillPoints;

            if (pad.IsButtonDown(Buttons.Start) && oldPad.IsButtonUp(Buttons.Start))
            {
                if (GameMain.Status == "on")
                {
                    current = 1;
                    this.status = "home";
                    GameMain.Status = "menu";
                }
                else
                    GameMain.Status = "on";
            }
            if (pad.IsButtonDown(Buttons.B) && oldPad.IsButtonUp(Buttons.B))
            {
                if (GameMain.Status == "menu")
                {
                    if (this.status == "home")
                    {
                        GameMain.Status = "on";
                    }
                    else if(this.status == "competences")
                    {
                        current = 1;
                        this.status = "home";
                    }
                }
            }
            if (GameMain.Status == "menu")
            {
                if (this.status == "home")
                {
                    if (pad.IsButtonDown(Buttons.LeftThumbstickDown) && !oldPad.IsButtonDown(Buttons.LeftThumbstickDown))
                    {
                        if (current < 3)
                        {
                            current++;
                        }
                    }
                    if (pad.IsButtonDown(Buttons.LeftThumbstickUp) && !oldPad.IsButtonDown(Buttons.LeftThumbstickUp))
                    {
                        if (current > 1)
                        {
                            current--;
                        }
                    }
                    if (pad.IsButtonDown(Buttons.A) && oldPad.IsButtonUp(Buttons.A))
                    {
                        if (current == 1)
                            this.status = "competences";
                        else if (current == 3)
                            FirstGame.exit = true;
                    }
                }
                else if (this.status == "competences")
                {
                    if (pad.IsButtonDown(Buttons.LeftThumbstickDown) && !oldPad.IsButtonDown(Buttons.LeftThumbstickDown))
                    {
                        if (current < 4)
                        {
                            current++;
                        }
                    }
                    if (pad.IsButtonDown(Buttons.LeftThumbstickUp) && !oldPad.IsButtonDown(Buttons.LeftThumbstickUp))
                    {
                        if (current > 1)
                        {
                            current--;
                        }
                    }
                    if (pad.IsButtonDown(Buttons.LeftThumbstickRight) && !oldPad.IsButtonDown(Buttons.LeftThumbstickRight))
                    {
                        if (this.side == 0)
                        {
                            this.side = 1;
                        }
                    }
                    if (pad.IsButtonDown(Buttons.LeftThumbstickLeft) && !oldPad.IsButtonDown(Buttons.LeftThumbstickLeft))
                    {
                        if (this.side == 1)
                        {
                            this.side = 0;
                        }
                    }
                    if (pad.IsButtonDown(Buttons.A) && oldPad.IsButtonUp(Buttons.A))
                    {
                        if (side == 0)
                        {
                            switch (current)
                            {
                                case 1:
                                    if (!j_cmp1_status && (_jbias - j_cmp1_price >= 0))
                                    {
                                        Jekyll._jskillsPoints -= j_cmp1_price;
                                        j_cmp1_status = true;
                                        jekyll.CanClimb = true;
                                    }
                                    break;
                                case 2:
                                    if (!j_cmp2_status && (_jbias - j_cmp2_price >= 0))
                                    {
                                        Jekyll._jskillsPoints -= j_cmp2_price;
                                        j_cmp2_status = true;
                                        jekyll.CanJVision = true;
                                    }
                                    break;
                                case 3:
                                    if (!j_cmp3_status && (_jbias - j_cmp3_price >= 0))
                                    {
                                        Jekyll._jskillsPoints -= j_cmp3_price;
                                        j_cmp3_status = true;
                                        jekyll.CanHide = true;
                                    }
                                    break;
                                case 4:
                                    if (!j_cmp4_status && (_jbias - j_cmp4_price >= 0))
                                    {
                                        Jekyll._jskillsPoints -= j_cmp4_price;
                                        j_cmp4_status = true;
                                    }
                                    break;
                            }
                        }
                        else
                        {
                            switch (current)
                            {
                                case 1:
                                    if (!h_cmp1_status && (_hbias - h_cmp1_price >= 0))
                                    {
                                        Hide._hskillPoints -= h_cmp1_price;
                                        h_cmp1_status = true;
                                        hide.CanJump = true;
                                    }
                                    break;
                                case 2:
                                    if (!h_cmp2_status && (_hbias - h_cmp2_price >= 0))
                                    {
                                        Hide._hskillPoints -= h_cmp2_price;
                                        h_cmp2_status = true;
                                        hide.CanHVision = true;
                                    }
                                    break;
                                case 3:
                                    if (!h_cmp3_status && (_hbias - h_cmp3_price >= 0))
                                    {
                                        Hide._hskillPoints -= h_cmp3_price;
                                        h_cmp3_status = true;
                                    }
                                    break;
                                case 4:
                                    if (!h_cmp4_status && (_hbias - h_cmp4_price >= 0))
                                    {
                                        Hide._hskillPoints -= h_cmp4_price;
                                        h_cmp4_status = true;
                                        hide.Health = 120;
                                    }
                                    break;
                            }
                        }
                    }
                }
            }
            oldPad = pad;
        }