// CONSTRUCTOR
        public GameMainMulti(string IP)
        {
            menu = new MainMenu(Global.Handler, 0f);
            this.IP = Global.MainMenu.ip;
            Walls = new List<Wall>();
            bonus = new List<Bonus>();
            enemies = new List<Enemy>();
            enemies2 = new List<Enemy2>();
            Global.GameMainMulti = this;
            player = new Player();
            player2 = new Player();
            readStream = new MemoryStream();
            writeStream = new MemoryStream();
            reader = new BinaryReader(readStream);
            writer = new BinaryWriter(writeStream);
            bullets = new Bullets(Resources.bullet);
            speedbonus = new List<VitesseBonus>();

            for (int x = 0; x < map.GetLength(1); x++)
            {
                for (int y = 0; y < map.GetLength(0); y++)
                {
                    int number = map[y, x];
                    if (number == 1)
                        Walls.Add(new Wall(x * size, y * size + size / 2, Resources.Brick_top, size, size, Color.White));
                    if (number == 2)
                        Walls.Add(new Wall(x * size, y * size + size / 2, Resources.Brick, size, size, Color.White));
                    if (number == 3)
                        Walls.Add(new Wall(x * size, y * size + size / 2, Resources.Platform, 100, 16, Color.Gray));
                    if (number == 4)
                        speedbonus.Add(new VitesseBonus(x * size + 40, y * size + 74, Resources.Speed, 20, 20, Color.White));
                }
            }
        }
        // CONSTRUCTOR
        public GameMain3()
        {
            menu = new MainMenu(Global.Handler, 0f);
            LocalPlayer = new Player();
            Walls = new List<Wall>();
            bonus = new List<Bonus>();
            enemies = new List<Enemy>();
            enemies2 = new List<Enemy2>();
            Global.GameMain3 = this;

            Walls.Add(new Wall(250, 400, Resources.Platform, 40, 12, Color.DodgerBlue));
            Walls.Add(new Wall(375, 350, Resources.Platform, 40, 12, Color.DodgerBlue));
            Walls.Add(new Wall(500, 400, Resources.Platform, 40, 12, Color.DodgerBlue));

            for (int i = 0; i < 80; i++)
                if (i != 3 & i != 4 & i != 5 & i != 6 & i != 7 & i != 8 & i != 9)
                    Walls.Add(new Wall(64 * i, 416, Resources.Ice_top, 64, 64, Color.White)); // Le sol
        }
        public void Update(GameTime gametime, Player player)
        {
            if (menu.EnJeu(menu.enjeu))
            {
                centre = new Vector2(player.Hitbox.X + player.Hitbox.Width / 2 - screenwidth / 2, 0);
                transform = Matrix.CreateTranslation(new Vector3(-centre.X, -centre.Y, 0));

                if (player.Hitbox.X < 400)
                    transform = Matrix.CreateTranslation(new Vector3(0, 0, 0));
                if (player.Hitbox.X > 4200)
                    transform = Matrix.CreateTranslation(new Vector3(-4200 + screenwidth / 2, -centre.Y, 0));
            }

            else
            {
                centre = new Vector2(0, 0);
                transform = Matrix.CreateTranslation(new Vector3(-centre.X, -centre.Y, 0));
            }
        }
Example #4
0
        // CONSTRUCTOR
        public GameMain5()
        {
            menu = new MainMenu(Global.Handler, 0f);
            LocalPlayer = new Player();
            Walls = new List<Wall>();
            bonus = new List<Bonus>();
            healthbonus = new List<HealthBonus>();
            speedbonus = new List<VitesseBonus>();
            enemies = new List<Enemy>();
            enemies2 = new List<Enemy2>();
            Global.GameMain5 = this;

            // Double Boucle qui fait marcher l'éditeur

            for (int x = 0; x < map.GetLength(1); x++)
            {
                for (int y = 0; y < map.GetLength(0); y++)
                {
                    int number = map[y, x];
                    if (number == 1)
                        Walls.Add(new Wall(x * size, y * size + size / 2, Resources.Sand_top, size, size, Color.White));
                    if (number == 2)
                        Walls.Add(new Wall(x * size, y * size + size / 2, Resources.Sand, size, size, Color.White));
                    if (number == 3)
                        enemies.Add(new Enemy(x * size, y * size, Resources.Zombie));
                    if (number == 4)
                        enemies2.Add(new Enemy2(x * size, y * size, Resources.Elite));
                    if (number == 5)
                        bonus.Add(new Bonus(x * size, y * size, Resources.Coin, 20, 20, Color.White));
                    if (number == 6)
                        healthbonus.Add(new HealthBonus(x * size, y * size, Resources.Health, 20, 20, Color.White));
                    if (number == 7)
                        speedbonus.Add(new VitesseBonus(x * size, y * size, Resources.Speed, 20, 20, Color.White));
                }
            }

            Walls.Add(new Wall(3600, 300, Resources.Platform, 100, 16, Color.LightYellow));
            Walls.Add(new Wall(3750, 250, Resources.Platform, 100, 16, Color.LightYellow));
            Walls.Add(new Wall(3900, 190, Resources.Platform, 50, 16, Color.LightYellow));
            Walls.Add(new Wall(4000, 150, Resources.Platform, 30, 10, Color.LightYellow));
        }
Example #5
0
        // CONSTRUCTOR
        public GameMain()
        {
            menu = new MainMenu(Global.Handler, 0f);
            LocalPlayer = new Player();
            Walls = new List<Wall>();
            bonus = new List<Bonus>();
            healthbonus = new List<HealthBonus>();
            speedbonus = new List<VitesseBonus>();
            enemies = new List<Enemy>();
            enemies2 = new List<Enemy2>();
            Global.GameMain = this;

            #region Ennemis
            //Ennemis

            enemies.Add(new Enemy(1100, 350, Resources.Zombie));
            enemies.Add(new Enemy(1150, 350, Resources.Zombie));
            enemies.Add(new Enemy(1180, 350, Resources.Zombie));
            enemies.Add(new Enemy(2550, 250, Resources.Zombie));
            enemies.Add(new Enemy(2650, 250, Resources.Zombie));

            enemies2.Add(new Enemy2(2400, 376, Resources.Zombie));

            #endregion

            #region Plateformes
            //Plateformes

            Walls.Add(new Wall(425, 245, Resources.Platform, 50, 16, Color.IndianRed));
            Walls.Add(new Wall(130, 360, Resources.Platform, 92, 16, Color.IndianRed));
            Walls.Add(new Wall(280, 300, Resources.Platform, 92, 16, Color.IndianRed));
            Walls.Add(new Wall(680, 365, Resources.Platform, 92, 16, Color.IndianRed));
            Walls.Add(new Wall(520, 300, Resources.Platform, 92, 16, Color.IndianRed));
            Walls.Add(new Wall(1160, 200, Resources.Platform, 92, 16, Color.IndianRed));
            Walls.Add(new Wall(1664, 350, Resources.Platform, 100, 16, Color.IndianRed));
            Walls.Add(new Wall(1820, 280, Resources.Platform, 100, 16, Color.IndianRed));
            Walls.Add(new Wall(1820, 140, Resources.Platform, 100, 16, Color.IndianRed));
            Walls.Add(new Wall(1664, 210, Resources.Platform, 100, 16, Color.IndianRed));
            Walls.Add(new Wall(1984, 140, Resources.Platform, 92, 16, Color.IndianRed));
            Walls.Add(new Wall(2100, 240, Resources.Platform, 92, 16, Color.IndianRed));
            Walls.Add(new Wall(2200, 340, Resources.Platform, 92, 16, Color.IndianRed));
            Walls.Add(new Wall(1984, 340, Resources.Platform, 50, 16, Color.IndianRed));
            Walls.Add(new Wall(2500, 340, Resources.Platform, 200, 16, Color.IndianRed));
            Walls.Add(new Wall(3520, 350, Resources.Platform, 92, 16, Color.IndianRed));
            Walls.Add(new Wall(3620, 300, Resources.Platform, 40, 16, Color.IndianRed));
            Walls.Add(new Wall(3680, 250, Resources.Platform, 20, 16, Color.IndianRed));
            Walls.Add(new Wall(3720, 200, Resources.Platform, 20, 16, Color.IndianRed));
            Walls.Add(new Wall(3860, 400, Resources.Platform, 92, 16, Color.IndianRed));
            Walls.Add(new Wall(4000, 340, Resources.Platform, 92, 16, Color.IndianRed));

            #endregion

            #region Terrain
            //Colonnes et sol

            Walls.Add(new Wall(896, 416, Resources.Ground, 64, 64, Color.White));
            Walls.Add(new Wall(896, 352, Resources.Herbe, 64, 64, Color.White));
            Walls.Add(new Wall(960, 416, Resources.Ground, 64, 64, Color.White));
            Walls.Add(new Wall(960, 352, Resources.Ground, 64, 64, Color.White));
            Walls.Add(new Wall(960, 288, Resources.Herbe, 64, 64, Color.White));
            Walls.Add(new Wall(1024, 416, Resources.Ground, 64, 64, Color.White));
            Walls.Add(new Wall(1024, 352, Resources.Ground, 64, 64, Color.White));
            Walls.Add(new Wall(1024, 288, Resources.Ground, 64, 64, Color.White));
            Walls.Add(new Wall(1024, 224, Resources.Herbe, 64, 64, Color.White));
            Walls.Add(new Wall(1600, 0, Resources.Ground, 64, 64, Color.White));
            Walls.Add(new Wall(1600, 64, Resources.Ground, 64, 64, Color.White));
            Walls.Add(new Wall(1600, 128, Resources.Ground, 64, 64, Color.White));
            Walls.Add(new Wall(1600, 192, Resources.Ground, 64, 64, Color.White));
            Walls.Add(new Wall(1600, 256, Resources.Ground, 64, 64, Color.White));
            Walls.Add(new Wall(1600, 320, Resources.Ground, 64, 64, Color.White));
            Walls.Add(new Wall(1920, 416, Resources.Ground, 64, 64, Color.White));
            Walls.Add(new Wall(1920, 352, Resources.Ground, 64, 64, Color.White));
            Walls.Add(new Wall(1920, 288, Resources.Ground, 64, 64, Color.White));
            Walls.Add(new Wall(1920, 224, Resources.Ground, 64, 64, Color.White));
            Walls.Add(new Wall(1920, 160, Resources.Ground, 64, 64, Color.White));
            Walls.Add(new Wall(1920, 96, Resources.Herbe, 64, 64, Color.White));
            Walls.Add(new Wall(2816, 416, Resources.Ground, 64, 64, Color.White));
            Walls.Add(new Wall(2816, 352, Resources.Herbe, 64, 64, Color.White));
            Walls.Add(new Wall(2944, 416, Resources.Ground, 64, 64, Color.White));
            Walls.Add(new Wall(2944, 352, Resources.Ground, 64, 64, Color.White));
            Walls.Add(new Wall(2944, 288, Resources.Herbe, 64, 64, Color.White));
            Walls.Add(new Wall(3072, 416, Resources.Ground, 64, 64, Color.White));
            Walls.Add(new Wall(3072, 352, Resources.Ground, 64, 64, Color.White));
            Walls.Add(new Wall(3072, 288, Resources.Ground, 64, 64, Color.White));
            Walls.Add(new Wall(3072, 224, Resources.Herbe, 64, 64, Color.White));
            Walls.Add(new Wall(3200, 416, Resources.Ground, 64, 64, Color.White));
            Walls.Add(new Wall(3200, 352, Resources.Ground, 64, 64, Color.White));
            Walls.Add(new Wall(3200, 288, Resources.Ground, 64, 64, Color.White));
            Walls.Add(new Wall(3200, 224, Resources.Ground, 64, 64, Color.White));
            Walls.Add(new Wall(3200, 160, Resources.Herbe, 64, 64, Color.White));

            //Sol

            for (int i = 0; i < 80; i++)
                if (i != 2 & i != 3 & i != 4 & i != 5 & i != 6 & i != 7 & i != 8 & i != 9
                  & i != 14 & i != 15 & i != 16 & i != 20 & i != 21 & i != 30
                  & i != 44 & i != 45 & i != 46 & i != 47 & i != 48 & i != 49 & i != 50 & i != 51
                  & i != 55 & i != 56 & i != 57 & i != 58 & i != 59 & i != 60 & i != 61 & i != 62)
                    Walls.Add(new Wall(64 * i, 416, Resources.Herbe, 64, 64, Color.White));
            #endregion

            #region Bonus
            //Bonus

            bonus.Add(new Bonus(700, 345, Resources.Coin, 20, 20, Color.White));
            bonus.Add(new Bonus(1200, 100, Resources.Coin, 20, 20, Color.White));
            bonus.Add(new Bonus(1940, 76, Resources.Coin, 20, 20, Color.White));
            bonus.Add(new Bonus(1984, 320, Resources.Coin, 20, 20, Color.White));
            bonus.Add(new Bonus(1984, 396, Resources.Coin, 20, 20, Color.White));
            bonus.Add(new Bonus(2520, 320, Resources.Coin, 20, 20, Color.White));
            bonus.Add(new Bonus(2650, 320, Resources.Coin, 20, 20, Color.White));
            bonus.Add(new Bonus(2816, 332, Resources.Coin, 20, 20, Color.White));
            bonus.Add(new Bonus(3200, 140, Resources.Coin, 20, 20, Color.White));
            bonus.Add(new Bonus(4020, 320, Resources.Coin, 20, 20, Color.White));

            healthbonus.Add(new HealthBonus(1800, 396, Resources.Health, 20, 20, Color.White));

            speedbonus.Add(new VitesseBonus(2224, 396, Resources.Speed, 20, 20, Color.White));

            #endregion
        }
Example #6
0
        // CONSTRUCTOR
        public GameMain2()
        {
            menu = new MainMenu(Global.Handler, 0f);
            LocalPlayer = new Player();
            Walls = new List<Wall>();
            lowspeedarea = new List<LowSpeedArea>();   //zone ralentie
            bonus = new List<Bonus>();
            healthbonus = new List<HealthBonus>();
            speedbonus = new List<VitesseBonus>();
            enemies = new List<Enemy>();
            enemies2 = new List<Enemy2>();
            particules = new List<Particules>();
            Global.GameMain2 = this;

            for (int i = 0; i < 200; i++)
            {
                larg = random.Next(0, 4600);
                haut = random.Next(0, 480);
                ent = random.Next(0, 2);
                particules.Add(new Particules(larg, haut, ent));
            }

            #region Ennemis
            enemies.Add(new Enemy(1288, 56, Resources.Zombie));
            enemies.Add(new Enemy(1188, 56, Resources.Zombie));
            enemies.Add(new Enemy(1388, 56, Resources.Zombie));
            enemies.Add(new Enemy(1150, 180, Resources.Zombie));
            enemies.Add(new Enemy(1150, 180, Resources.Zombie));
            enemies.Add(new Enemy(1088, 260, Resources.Zombie));
            enemies.Add(new Enemy(1302, 300, Resources.Zombie));
            enemies.Add(new Enemy(1302, 300, Resources.Zombie));
            enemies.Add(new Enemy(1150, 340, Resources.Zombie));
            enemies.Add(new Enemy(2800, 340, Resources.Zombie));

            enemies2.Add(new Enemy2(4500, 340, Resources.Elite));
            enemies2.Add(new Enemy2(1150, 340, Resources.Elite));
            #endregion

            #region Plateformes
            Walls.Add(new Wall(240, 400, Resources.Platform, 100, 16, Color.White));
            Walls.Add(new Wall(340, 330, Resources.Platform, 100, 16, Color.White));
            Walls.Add(new Wall(490, 380, Resources.Platform, 100, 16, Color.White));
            Walls.Add(new Wall(1088, 96, Resources.Platform, 450, 16, Color.White));
            Walls.Add(new Wall(1150, 180, Resources.Platform, 450, 16, Color.White));
            Walls.Add(new Wall(1088, 260, Resources.Platform, 450, 16, Color.White));
            Walls.Add(new Wall(1150, 340, Resources.Platform, 450, 16, Color.White));
            Walls.Add(new Wall(2440, 340, Resources.Platform, 50, 16, Color.White));
            Walls.Add(new Wall(2500, 280, Resources.Platform, 50, 16, Color.White));
            Walls.Add(new Wall(2580, 220, Resources.Platform, 50, 16, Color.White));
            Walls.Add(new Wall(2640, 160, Resources.Platform, 240, 16, Color.White));
            #endregion

            #region Terrain
            Walls.Add(new Wall(768, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(768, 352, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(832, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(832, 352, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(832, 288, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(896, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(896, 352, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(896, 288, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(896, 224, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(960, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(960, 352, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(960, 288, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(960, 224, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(960, 160, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1024, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1024, 352, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1024, 288, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1024, 224, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1024, 160, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1024, 96, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1600, 288, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1600, 224, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1600, 160, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1600, 96, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1600, 32, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1600, -32, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1920, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1984, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(2112, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(2176, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(2240, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1920, 352, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1984, 352, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(2112, 352, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(2176, 352, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(2240, 352, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(2880, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(2880, 352, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(2880, 288, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(2880, 224, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(2880, 160, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(2880, 64, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(2880, 0, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3200, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3200, 352, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3328, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3328, 352, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3328, 288, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3456, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3456, 352, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3456, 288, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3456, 224, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3584, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3584, 352, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3584, 288, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3584, 224, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3584, 160, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3712, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3712, 352, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3712, 288, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3712, 224, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3712, 160, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3712, 96, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3904, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3904, 352, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3904, 288, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3904, 224, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3904, 160, Resources.Herbe_neige, 64, 64, Color.White));

            for (int i = 0; i < 80; i++)
                if (i != 3 & i != 4 & i != 5 & i != 6 & i != 7 & i != 8 & i != 9
                           & i != 12 & i != 13 & i != 14 & i != 15 & i != 16 & i != 27 & i != 28
                           & i != 30 & i != 31 & i != 32 & i != 33 & i != 34 & i != 35 & i != 45
                           & i != 50 & i != 51 & i != 52 & i != 53 & i != 54 & i != 55 & i != 56 & i != 57 & i != 58 & i != 59 & i != 60 & i != 61 & i != 62 & i != 63)
                    Walls.Add(new Wall(64 * i, 416, Resources.Herbe_neige, 64, 64, Color.White));
            #endregion

            #region Bonus
            bonus.Add(new Bonus(384, 300, Resources.Coin, 20, 20, Color.White));
            bonus.Add(new Bonus(4000, 100, Resources.Coin, 20, 20, Color.White));
            bonus.Add(new Bonus(1100, 240, Resources.Coin, 20, 20, Color.White));
            bonus.Add(new Bonus(1288, 56, Resources.Coin, 20, 20, Color.White));
            bonus.Add(new Bonus(2060, 300, Resources.Coin, 20, 20, Color.White));
            bonus.Add(new Bonus(2820, 396, Resources.Coin, 20, 20, Color.White));
            healthbonus.Add(new HealthBonus(1500, 320, Resources.Health, 20, 20, Color.White));
            #endregion

            lowspeedarea.Add(new LowSpeedArea(2450, 415, Resources.Platform, 300, 2, Color.Brown));
        }
Example #7
0
        // CONSTRUCTOR
        public GameMain3()
        {
            menu = new MainMenu(Global.Handler, 0f);
            LocalPlayer = new Player();
            Walls = new List<Wall>();
            bonus = new List<Bonus>();
            enemies = new List<Enemy>();
            enemies2 = new List<Enemy2>();
            piques = new List<Piques>();
            Global.GameMain3 = this;

            #region Ennemis
            enemies.Add(new Enemy(700, 350, Resources.Zombie));
            enemies.Add(new Enemy(3780, 150, Resources.Zombie));
            enemies.Add(new Enemy(3850, 150, Resources.Zombie));
            enemies.Add(new Enemy(3920, 150, Resources.Zombie));
            #endregion

            #region Piques
            piques.Add(new Piques(2112, 268, Resources.bullet, 64, 20, Color.White));
            piques.Add(new Piques(2240, 268, Resources.bullet, 64, 20, Color.White));
            piques.Add(new Piques(2368, 268, Resources.bullet, 64, 20, Color.White));
            piques.Add(new Piques(2496, 268, Resources.bullet, 64, 20, Color.White));
            piques.Add(new Piques(2624, 268, Resources.bullet, 64, 20, Color.White));
            piques.Add(new Piques(2752, 268, Resources.bullet, 64, 20, Color.White));
            #endregion

            #region Plateformes
            Walls.Add(new Wall(250, 400, Resources.Platform, 40, 12, Color.DodgerBlue));
            Walls.Add(new Wall(375, 350, Resources.Platform, 40, 12, Color.DodgerBlue));
            Walls.Add(new Wall(500, 400, Resources.Platform, 40, 12, Color.DodgerBlue));
            Walls.Add(new Wall(1164, 350, Resources.Platform, 40, 12, Color.DodgerBlue));
            Walls.Add(new Wall(1277, 416, Resources.Platform, 3, 12, Color.DodgerBlue)); //mini
            Walls.Add(new Wall(1802, 340, Resources.Platform, 54, 12, Color.DodgerBlue));
            Walls.Add(new Wall(1664, 308, Resources.Platform, 54, 12, Color.DodgerBlue));
            Walls.Add(new Wall(1610, 105, Resources.Platform, 54, 12, Color.DodgerBlue));
            Walls.Add(new Wall(2242, 468, Resources.Platform, 60, 12, Color.DodgerBlue));
            Walls.Add(new Wall(2626, 468, Resources.Platform, 60, 12, Color.DodgerBlue));
            Walls.Add(new Wall(3580, 370, Resources.Platform, 96, 12, Color.DodgerBlue));
            Walls.Add(new Wall(3490, 290, Resources.Platform, 96, 12, Color.DodgerBlue));
            Walls.Add(new Wall(3400, 210, Resources.Platform, 96, 12, Color.DodgerBlue));
            Walls.Add(new Wall(3640, 458, Resources.Platform, 40, 12, Color.DodgerBlue));
            Walls.Add(new Wall(3775, 410, Resources.Platform, 96, 12, Color.DodgerBlue));
            Walls.Add(new Wall(3550, 140, Resources.Platform, 96, 12, Color.DodgerBlue));
            Walls.Add(new Wall(3700, 80, Resources.Platform, 300, 12, Color.DodgerBlue));
            Walls.Add(new Wall(3700, 190, Resources.Platform, 300, 12, Color.DodgerBlue));
            Walls.Add(new Wall(3700, 189, Resources.Platform, 1, 1, Color.DodgerBlue));
            Walls.Add(new Wall(4000, 189, Resources.Platform, 1, 1, Color.DodgerBlue));
            Walls.Add(new Wall(3880, 320, Resources.Platform, 80, 12, Color.DodgerBlue));
            Walls.Add(new Wall(3880, 320, Resources.Platform, 80, 12, Color.DodgerBlue));
            Walls.Add(new Wall(4140, 416, Resources.Platform, 20, 12, Color.DodgerBlue));
            #endregion

            #region Terrain
            Walls.Add(new Wall(640, 415, Resources.Ice_top, 1, 1, Color.White));
            for (int i = 0; i <= 72; i++) //pour une taille de 4600
            {
                if (i != 3 & i != 4 & i != 5 & i != 6 & i != 7 & i != 8 & i != 9 & i != 12 & i != 13 & i != 14 & i != 15
                    & i != 16 & i != 17 & i != 18 & i != 19 & i != 22 & i != 23 & i != 25 & i != 34 & i != 35 & i != 36 & i != 40 & i != 41 & i != 42
                    & i != 55 & i != 56 & i != 57 & i != 58 & i != 59 & i != 60 & i != 61 & i != 62 & i != 63 & i != 64 & i != 69 & i != 70 & i != 71)
                    Walls.Add(new Wall(64 * i, 416, Resources.Ice_top, 64, 64, Color.White)); // Le sol
            }
            for (int i = 30; i <= 46; i++)
            {
                Walls.Add(new Wall(64 * i, 288, Resources.Ice, 64, 64, Color.White));
                if (i != 33 & i != 35 & i != 37 & i != 39 & i != 41 & i != 43 & i != 46)
                {
                    Walls.Add(new Wall(64 * i, 224, Resources.Ice, 64, 64, Color.White));
                    Walls.Add(new Wall(64 * i, 160, Resources.Ice_top, 64, 64, Color.White));
                }
            }
            //Passage 1
            for (int i = 12; i <= 24; i++)
            {
                if (i != 15 & i != 17 & i != 18 & i != 19)
                {
                    if (i != 20 & i != 21)
                    {
                        Walls.Add(new Wall(64 * i, 352, Resources.Ice_top, 64, 64, Color.White));
                        Walls.Add(new Wall(64 * i, 416, Resources.Ice, 64, 64, Color.White));
                    }

                    if (i != 12 & i != 24)
                    {
                        Walls.Add(new Wall(64 * i, 288, Resources.Ice_top, 64, 64, Color.White));
                        if (i != 20 & i != 21)
                            Walls.Add(new Wall(64 * i, 352, Resources.Ice, 64, 64, Color.White));
                    }
                }
            }
            //Passage 2
            Walls.Add(new Wall(1472, 0, Resources.Ice, 64, 64, Color.White));
            Walls.Add(new Wall(1472, 64, Resources.Ice, 64, 64, Color.White));
            Walls.Add(new Wall(1472, 128, Resources.Ice, 64, 64, Color.White));
            Walls.Add(new Wall(1536, 192, Resources.Ice, 64, 64, Color.White));
            Walls.Add(new Wall(1600, 256, Resources.Ice, 64, 64, Color.White));
            Walls.Add(new Wall(1664, 96, Resources.Ice_top, 64, 64, Color.White));
            Walls.Add(new Wall(1728, 96, Resources.Ice_top, 64, 64, Color.White));
            Walls.Add(new Wall(1792, 96, Resources.Ice_top, 64, 64, Color.White));
            Walls.Add(new Wall(1792, 160, Resources.Ice, 64, 64, Color.White));
            Walls.Add(new Wall(1856, 96, Resources.Ice_top, 64, 64, Color.White));
            Walls.Add(new Wall(1856, 288, Resources.Ice, 64, 64, Color.White));
            Walls.Add(new Wall(1856, 224, Resources.Ice, 64, 64, Color.White));
            Walls.Add(new Wall(1856, 160, Resources.Ice, 64, 64, Color.White));
            Walls.Add(new Wall(2944, 224, Resources.Ice_top, 64, 64, Color.White));
            Walls.Add(new Wall(3008, 288, Resources.Ice_top, 64, 64, Color.White));
            Walls.Add(new Wall(4414, 416, Resources.Ice, 64, 64, Color.White));
            Walls.Add(new Wall(4478, 416, Resources.Ice, 64, 64, Color.White));
            Walls.Add(new Wall(4542, 416, Resources.Ice, 64, 64, Color.White));
            Walls.Add(new Wall(4414, 352, Resources.Ice_top, 64, 64, Color.White));
            Walls.Add(new Wall(4478, 352, Resources.Ice, 64, 64, Color.White));
            Walls.Add(new Wall(4542, 352, Resources.Ice, 64, 64, Color.White));
            Walls.Add(new Wall(4478, 288, Resources.Ice_top, 64, 64, Color.White));
            Walls.Add(new Wall(4542, 288, Resources.Ice, 64, 64, Color.White));
            Walls.Add(new Wall(4542, 224, Resources.Ice_top, 64, 64, Color.White));
            #endregion

            #region Bonus
            bonus.Add(new Bonus(260, 380, Resources.Coin, 20, 20, Color.White));
            bonus.Add(new Bonus(1335, 390, Resources.Coin, 20, 20, Color.White));
            bonus.Add(new Bonus(2262, 448, Resources.Coin, 20, 20, Color.White));
            bonus.Add(new Bonus(2262, 448, Resources.Coin, 20, 20, Color.White));
            bonus.Add(new Bonus(2646, 448, Resources.Coin, 20, 20, Color.White));
            bonus.Add(new Bonus(2870, 140, Resources.Coin, 20, 20, Color.White));
            bonus.Add(new Bonus(3650, 438, Resources.Coin, 20, 20, Color.White));
            bonus.Add(new Bonus(3840, 170, Resources.Coin, 20, 20, Color.White));
            bonus.Add(new Bonus(3910, 300, Resources.Coin, 20, 20, Color.White));
            #endregion
        }
Example #8
0
        // CONSTRUCTOR
        public GameMain4()
        {
            menu = new MainMenu(Global.Handler, 0f);
            LocalPlayer = new Player();
            Walls = new List<Wall>();
            lowspeedarea = new List<LowSpeedArea>();   //zone ralentie
            bonus = new List<Bonus>();
            healthbonus = new List<HealthBonus>();
            speedbonus = new List<VitesseBonus>();
            enemies = new List<Enemy>();
            enemies2 = new List<Enemy2>();
            movinghorizontallywalls = new List<MovingHorizontallyWall>();
            Global.GameMain4 = this;

            for (int x = 0; x < map.GetLength(1); x++)
            {
                for (int y = 0; y < map.GetLength(0); y++)
                {
                    int number = map[y, x];
                    if (number == 1)
                        Walls.Add(new Wall(x * size, y * size + size / 2, Resources.Roche_top, size, size, Color.White));
                    if (number == 2)
                        Walls.Add(new Wall(x * size, y * size + size / 2, Resources.Roche, size, size, Color.White));
                    if (number == 3)
                        enemies.Add(new Enemy(x * size, y * size, Resources.Zombie));
                    if (number == 4)
                        enemies2.Add(new Enemy2(x * size, y * size, Resources.Elite));

                }

            }

            #region Plateformes
            //Plateformes

            Walls.Add(new Wall(425, 275, Resources.Platform, 90, 16, Color.FloralWhite));
            Walls.Add(new Wall(560, 220, Resources.Platform, 90, 16, Color.FloralWhite));
            Walls.Add(new Wall(695, 170, Resources.Platform, 256, 16, Color.FloralWhite));
            Walls.Add(new Wall(1030, 220, Resources.Platform, 90, 16, Color.FloralWhite));
            Walls.Add(new Wall(1344, 470, Resources.Platform, 384, 16, Color.FloralWhite));

            #endregion

            #region Terrain

            #endregion

            #region Bonus

            bonus.Add(new Bonus(812, 270, Resources.Coin, 20, 20, Color.White));
            bonus.Add(new Bonus(1045, 200, Resources.Coin, 20, 20, Color.White));
            bonus.Add(new Bonus(1526, 450, Resources.Coin, 20, 20, Color.White));
            bonus.Add(new Bonus(2200, 396, Resources.Coin, 20, 20, Color.White));
            bonus.Add(new Bonus(2646, 332, Resources.Coin, 20, 20, Color.White));
            bonus.Add(new Bonus(4200, 150, Resources.Coin, 20, 20, Color.White));
            speedbonus.Add(new VitesseBonus(512, 332, Resources.Speed, 20, 20, Color.White));
            speedbonus.Add(new VitesseBonus(3050, 332, Resources.Speed, 20, 20, Color.White));
            healthbonus.Add(new HealthBonus(1085, 200, Resources.Health, 20, 20, Color.White));
            #endregion

            lowspeedarea.Add(new LowSpeedArea(256, 350, Resources.Platform, 200, 2, Color.Brown));
        }
Example #9
0
        public MainMenu(Game game, float startTime)
            : base(game)
        {
            // Constructeur:
            time = startTime;
            started = false;
            paused = false;
            finished = false;
            Text = "0";
            coeur_sound_instance = Resources.CoeurRapide.CreateInstance();
            piece_sound_instance = Resources.piece.CreateInstance();
            nb_pieces = 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\Button_jouer"));
            main.Add(new GUIElement(@"Sprites\Menu\Button_options"));
            main.Add(new GUIElement(@"Sprites\Menu\Button_quitter"));
            main.Add(new GUIElement(@"Sprites\Menu\Bouton_Credits"));

            InOptions.Add(new GUIElement(@"Sprites\Menu\Bouton_Retour"));
            InOptions.Add(new GUIElement(@"Sprites\Menu\Bouton_Volume"));
            InOptions.Add(new GUIElement(@"Sprites\Menu\Bouton_Plus"));
            InOptions.Add(new GUIElement(@"Sprites\Menu\Bouton_Moins"));
            InOptions.Add(new GUIElement(@"Sprites\Menu\Bouton_Bruitages"));
            InOptions.Add(new GUIElement(@"Sprites\Menu\Bouton_Plus2"));
            InOptions.Add(new GUIElement(@"Sprites\Menu\Bouton_Moins2"));
            InOptions.Add(new GUIElement(@"Sprites\Menu\Bouton_Commandes"));
            InOptions.Add(new GUIElement(@"Sprites\Menu\Bouton_PleinEcran"));

            InPause.Add(new GUIElement(@"Sprites\Menu\Bouton_Continuer"));
            InPause.Add(new GUIElement(@"Sprites\Menu\Button_options"));
            InPause.Add(new GUIElement(@"Sprites\Menu\Bouton_MenuPrincipalGros"));
            InPause.Add(new GUIElement(@"Sprites\Menu\Button_quitter"));

            HowToPlay.Add(new GUIElement(@"Sprites\Menu\Bouton_RetourToOptions"));

            SelectionMap.Add(new GUIElement(@"Sprites\Menu\Bouton_NouvellePartie"));
            SelectionMap.Add(new GUIElement(@"Sprites\Menu\Bouton_Multijoueur"));
            SelectionMap.Add(new GUIElement(@"Sprites\Menu\Bouton_Retour"));
            SelectionMap.Add(new GUIElement(@"Sprites\Menu\Bouton_Chapitres"));

            GameOver.Add(new GUIElement(@"Sprites\Menu\Boutton_Rejouer"));
            GameOver.Add(new GUIElement(@"Sprites\Menu\Bouton_MenuPrincipal"));

            Credits.Add(new GUIElement(@"Sprites\Menu\Bouton_Retour"));

            Won.Add(new GUIElement(@"Sprites\Menu\Bouton_NiveauSuivant"));
            Won.Add(new GUIElement(@"Sprites\Menu\Boutton_Rejouer"));
            Won.Add(new GUIElement(@"Sprites\Menu\Bouton_MenuPrincipal"));

            Chapitre1.Add(new GUIElement(@"Sprites\Menu\Bouton_RetourToJouer"));
            Chapitre1.Add(new GUIElement(@"Sprites\Menu\Level1"));
            Chapitre1.Add(new GUIElement(@"Sprites\Menu\fleche_droite"));

            Chapitre2.Add(new GUIElement(@"Sprites\Menu\Bouton_RetourToJouer"));
            Chapitre2.Add(new GUIElement(@"Sprites\Menu\Level2"));
            Chapitre2.Add(new GUIElement(@"Sprites\Menu\fleche_droite2"));
            Chapitre2.Add(new GUIElement(@"Sprites\Menu\fleche_gauche"));

            Chapitre3.Add(new GUIElement(@"Sprites\Menu\Bouton_RetourToJouer"));
            Chapitre3.Add(new GUIElement(@"Sprites\Menu\Level3"));
            Chapitre3.Add(new GUIElement(@"Sprites\Menu\fleche_gauche2"));

            Multi.Add(new GUIElement(@"Sprites\Menu\Join"));
            Multi.Add(new GUIElement(@"Sprites\Menu\Create"));
            Multi.Add(new GUIElement(@"Sprites\Menu\Bouton_RetourToJouer"));

            player = Global.Player;
            player2 = Global.Player;
            player3 = Global.Player;
            Main = Global.GameMain;
            Main2 = Global.GameMain2;
            Main3 = Global.GameMain3;
            Global.MainMenu = this;
        }
Example #10
0
        // Détecte si l'on clique sur un GUIRect donc sur un bouton et fait le changement d'état.
        public void OnClick(string element)
        {
            if (element == @"Sprites\Menu\Button_jouer")
            {
                gameState = GameState.SelectionMap;
            }

            if (element == @"Sprites\Menu\Button_options")
            {
                gameState = GameState.InOptions;
            }

            if (element == @"Sprites\Menu\Button_quitter")
            {
                gameState = GameState.InClose;
            }
            if (element == @"Sprites\Menu\Bouton_Retour")
            {
                if (HasPlayed == true)
                {
                    gameState = GameState.InPause;
                }
                else
                    gameState = GameState.MainMenu;

            }

            //Modification du volume

            if (element == @"Sprites\Menu\Bouton_Plus")
            {
                if (MediaPlayer.Volume >= 0.9f)
                    MediaPlayer.Volume = 1f;
                else MediaPlayer.Volume = MediaPlayer.Volume + 0.1f;
            }
            if (element == @"Sprites\Menu\Bouton_Moins")
            {
                if (MediaPlayer.Volume <= 0.1f)
                    MediaPlayer.Volume = 0f;
                else MediaPlayer.Volume = MediaPlayer.Volume - 0.1f;
            }
            if (element == @"Sprites\Menu\Bouton_Plus2")
            {
                if (SoundEffect.MasterVolume >= 0.9f)
                    SoundEffect.MasterVolume = 1f;
                else SoundEffect.MasterVolume = SoundEffect.MasterVolume + 0.1f;
            }
            if (element == @"Sprites\Menu\Bouton_Moins2")
            {
                if (SoundEffect.MasterVolume <= 0.1f)
                    SoundEffect.MasterVolume = 0f;
                else SoundEffect.MasterVolume = SoundEffect.MasterVolume - 0.1f;
            }
            if (element == @"Sprites\Menu\Bouton_Continuer")
            {
                if (comptlevel == 1)
                    gameState = GameState.InGame;
                else if (comptlevel == 2)
                    gameState = GameState.InGame2;
                else if (comptlevel == 3)
                    gameState = GameState.InGame3;
            }
            if (element == @"Sprites\Menu\Boutton_Rejouer")
            {
                enjeu = true;
                Global.Handler.ammo_left = 6;
                Global.Handler.recharge_left = 5;
                score = 300;
                time = 0f;
                MediaPlayer.Volume = 0.6f;
                HasPlayed = true;
                {
                    if (comptlevel == 1)
                    {
                        Main = new GameMain();
                        player = new Player();
                        gameState = GameState.InGame;
                        MediaPlayer.Volume = MediaPlayer.Volume;
                        MediaPlayer.Stop();
                        MediaPlayer.Play(Resources.MusiqueMain);
                        MediaPlayer.Volume = MediaPlayer.Volume;
                        MediaPlayer.IsRepeating = true;
                    }
                    else if (comptlevel == 2)
                    {
                        Main2 = new GameMain2();
                        player2 = new Player();
                        gameState = GameState.InGame2;
                        MediaPlayer.Volume = MediaPlayer.Volume;
                        MediaPlayer.Stop();
                        MediaPlayer.Play(Resources.Musique2);
                        MediaPlayer.Volume = MediaPlayer.Volume;
                        MediaPlayer.IsRepeating = true;
                    }
                    else if (comptlevel == 3)
                    {
                        Main3 = new GameMain3();
                        player3 = new Player();
                        gameState = GameState.InGame3;
                        MediaPlayer.Volume = MediaPlayer.Volume;
                        MediaPlayer.Stop();
                        MediaPlayer.Play(Resources.Musique3);
                        MediaPlayer.Volume = MediaPlayer.Volume;
                        MediaPlayer.IsRepeating = true;
                    }

                }
            }
            if (element == @"Sprites\Menu\Bouton_MenuPrincipal")
            {
                //On réinitialise le HUD
                nb_pieces = 0;
                score = 300;
                time = 0f;
                comptlevel = 0;

                gameState = GameState.MainMenu;
                HasPlayed = false;
                MediaPlayer.Volume = 0.6f;
                MediaPlayer.Stop();
                MediaPlayer.Play(Resources.MusiqueMenu);
                MediaPlayer.Volume = MediaPlayer.Volume;
                MediaPlayer.IsRepeating = true;
            }
            if (element == @"Sprites\Menu\Bouton_MenuPrincipalGros")
            {
                //On réinitialise le HUD
                score = 300;
                nb_pieces = 0;
                time = 0f;
                comptlevel = 0;

                gameState = GameState.MainMenu;
                HasPlayed = false;
                MediaPlayer.Volume = 0.6f;
                MediaPlayer.Stop();
                MediaPlayer.Play(Resources.MusiqueMenu);
                MediaPlayer.Volume = MediaPlayer.Volume;
                MediaPlayer.IsRepeating = true;
            }
            if (element == @"Sprites\Menu\Bouton_Commandes")
            {
                gameState = GameState.HowToPlay;
            }
            if (element == @"Sprites\Menu\Bouton_NouvellePartie")
            {
                score = 300;
                time = 0f;
                nb_pieces = 0;
                enjeu = true;
                // HasPlayed détecte si le joueur a déjà lancé une partie pour pouvoir la récupérer après.
                Global.Handler.ammo_left = 6;
                Global.Handler.recharge_left = 5;
                HasPlayed = true;
                comptlevel = 1;
                Main = new GameMain();
                player = new Player();
                gameState = GameState.Scenario;
                MediaPlayer.Volume = MediaPlayer.Volume;
                MediaPlayer.Stop();
                MediaPlayer.Play(Resources.MusiqueMain);
                MediaPlayer.Volume = MediaPlayer.Volume;
                MediaPlayer.IsRepeating = true;
            }
            if (element == @"Sprites\Menu\Boutton_Rejouer")
            {
                nb_pieces = 0;
                HasPlayed = true;
                if (comptlevel == 1)
                {
                    Main = new GameMain();
                    player = new Player();
                    gameState = GameState.InGame;
                }
                else if (comptlevel == 2)
                {
                    Main2 = new GameMain2();
                    player2 = new Player();
                    gameState = GameState.InGame2;
                    MediaPlayer.Stop();
                    MediaPlayer.Play(Resources.Musique2);
                    MediaPlayer.Volume = MediaPlayer.Volume;
                }
                else if (comptlevel == 3)
                {
                    Main3 = new GameMain3();
                    player3 = new Player();
                    gameState = GameState.InGame3;
                    MediaPlayer.Stop();
                    MediaPlayer.Play(Resources.Musique3);
                    MediaPlayer.Volume = MediaPlayer.Volume;
                }
                MediaPlayer.Volume = MediaPlayer.Volume;
                MediaPlayer.Stop();
                MediaPlayer.Play(Resources.MusiqueMain);
                MediaPlayer.Volume = MediaPlayer.Volume;
                MediaPlayer.IsRepeating = true;
            }
            if (element == @"Sprites\Menu\Bouton_Credits")
            {
                gameState = GameState.Credits;
            }
            if (element == @"Sprites\Menu\Bouton_RetourToOptions")
            {
                gameState = GameState.InOptions;
            }
            if (element == @"Sprites\Menu\Bouton_RetourToJouer")
            {
                gameState = GameState.SelectionMap;
            }
            if (element == @"Sprites\Menu\Bouton_Chapitres")
            {
                gameState = GameState.Chapitre1;
            }
            if (element == @"Sprites\Menu\Level1")
            {
                enjeu = true;
                time = 0f;
                score = 300;
                nb_pieces = 0;
                Global.Handler.recharge_left = 5;
                Global.Handler.ammo_left = 6;
                HasPlayed = true;
                comptlevel = 1;
                Main = new GameMain();
                player = new Player();
                gameState = GameState.InGame;
                MediaPlayer.Volume = MediaPlayer.Volume;
                MediaPlayer.Stop();
                MediaPlayer.Play(Resources.MusiqueMain);
                MediaPlayer.Volume = MediaPlayer.Volume;
                MediaPlayer.IsRepeating = true;
            }
            if (element == @"Sprites\Menu\Level2")
            {
                enjeu = true;
                time = 0f;
                score = 300;
                nb_pieces = 0;
                Global.Handler.recharge_left = 5;
                Global.Handler.ammo_left = 6;
                HasPlayed = true;
                comptlevel = 2;
                Main2 = new GameMain2();
                player2 = new Player();
                gameState = GameState.InGame2;
                MediaPlayer.Volume = MediaPlayer.Volume;
                MediaPlayer.Stop();
                MediaPlayer.Play(Resources.Musique2);
                MediaPlayer.Volume = MediaPlayer.Volume;
                MediaPlayer.IsRepeating = true;
            }
            if (element == @"Sprites\Menu\Level3")
            {
                enjeu = true;
                time = 0f;
                score = 300;
                nb_pieces = 0;
                Global.Handler.recharge_left = 5;
                Global.Handler.ammo_left = 6;
                HasPlayed = true;
                comptlevel = 3;
                Main3 = new GameMain3();
                player3 = new Player();
                gameState = GameState.InGame3;
                MediaPlayer.Volume = MediaPlayer.Volume;
                MediaPlayer.Stop();
                MediaPlayer.Play(Resources.Musique3);
                MediaPlayer.Volume = MediaPlayer.Volume;
                MediaPlayer.IsRepeating = true;
            }

            if (element == @"Sprites\Menu\Bouton_NiveauSuivant")
            {
                enjeu = true;
                time = 0f;
                score = 300;
                nb_pieces = 0;
                Global.Handler.recharge_left = 5;
                Global.Handler.ammo_left = 6;
                if (comptlevel == 1)
                {
                    Main2 = new GameMain2();
                    player2 = new Player();
                    gameState = GameState.InGame2;
                    MediaPlayer.Volume = MediaPlayer.Volume;
                    MediaPlayer.Stop();
                    MediaPlayer.Play(Resources.Musique2);
                    MediaPlayer.Volume = MediaPlayer.Volume;
                    MediaPlayer.IsRepeating = true;
                }
                //Sinon on était au level 2 donc on passe au 3
                else
                {
                    Main3 = new GameMain3();
                    player3 = new Player();
                    gameState = GameState.InGame3;
                    MediaPlayer.Volume = MediaPlayer.Volume;
                    MediaPlayer.Stop();
                    MediaPlayer.Play(Resources.Musique3);
                    MediaPlayer.Volume = MediaPlayer.Volume;
                    MediaPlayer.IsRepeating = true;
                }
            }

            if (element == @"Sprites\Menu\Bouton_PleinEcran")
            {
                Global.Handler.graphics.ToggleFullScreen();
            }

            if (element == @"Sprites\Menu\fleche_droite")
            {
                gameState = GameState.Chapitre2;
            }

            if (element == @"Sprites\Menu\fleche_droite2")
            {
                gameState = GameState.Chapitre3;
            }

            if (element == @"Sprites\Menu\fleche_gauche")
            {
                gameState = GameState.Chapitre1;
            }

            if (element == @"Sprites\Menu\fleche_gauche2")
            {
                gameState = GameState.Chapitre2;
            }

            if (element == @"Sprites\Menu\Bouton_Multijoueur")
            {
                gameState = GameState.Multi;
            }

            if (element == @"Sprites\Menu\Create")
            {
                gameState = GameState.Multi;
                Global.Multi.Connect();
                Global.Multi.CreateLobby();
            }

            if (element == @"Sprites\Menu\Join")
            {
                gameState = GameState.Multi;
                Global.Multi.Connect();
            }
        }
Example #11
0
        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;

            }
        }
Example #12
0
        public void UpdateGame(Player player, GameTime gameTime, int level, int distanceToWin, int timeToLoose)
        {
            #region Timer
            if (Global.Collisions.collision_speed)
            {
                GameTime timer_b = new GameTime();
                timer_bonus += (float)gameTime.ElapsedGameTime.TotalSeconds;
                if (timer_bonus > 10)
                {
                    Global.Collisions.collision_speed = false;
                    timer_bonus = 0;
                }
            }
            deltaTime = (float)gameTime.ElapsedGameTime.TotalSeconds;

            if (started)
            {
                if (!paused)
                {
                    if (time >= 0)
                        time += deltaTime;
                    else
                        finished = true;
                }
            }

            Text = ((int)time).ToString();
            score = (nb_pieces * 10) + timeToLoose - ((int)time) + enemies_dead * 20 - nb_players_dead * 10;

            if (time == timeToLoose)
            {
                gameState = GameState.GameOver;
                MediaPlayer.Stop();
                MediaPlayer.Play(Resources.MusiqueGameOver);
                MediaPlayer.IsRepeating = false;
            }
            #endregion

            if (player.Hitbox.X > distanceToWin)
            {
                MediaPlayer.Stop();
                MediaPlayer.Play(Resources.MusiqueVictory);
                MediaPlayer.IsRepeating = false;
                gameState = GameState.Won;
                if (lvlcomplete < level)
                    lvlcomplete = level;
            }
            if ((Keyboard.GetState().IsKeyDown(Keys.P) && pastkey.IsKeyUp(Keys.P)) || (Keyboard.GetState().IsKeyDown(Keys.Escape) && pastkey.IsKeyUp(Keys.Escape)))
            {
                gameState = GameState.InPause;
                MediaPlayer.Volume = 0.2f;
            }
            pastkey = Keyboard.GetState();
            enjeu = true;
            if (player.health == 0 || player.dead && gameState != GameState.InGameMulti)
            {
                if (comptlevel == 6)
                {
                    boss_already_appeared = false;
                    boss_appeared = false;
                }

                enjeu = false;
                nb_players_dead++;
                gameState = GameState.GameOver;
                MediaPlayer.Stop();
                MediaPlayer.Play(Resources.MusiqueGameOver);
                MediaPlayer.IsRepeating = false;
            }
        }
Example #13
0
        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;
        }
        // CONSTRUCTOR
        public GameMain2()
        {
            menu = new MainMenu(Global.Handler, 0f);
            LocalPlayer = new Player();
            Walls = new List<Wall>();
            bonus = new List<Bonus>();
            enemies = new List<Enemy>();
            enemies2 = new List<Enemy2>();
            Global.GameMain2 = this;

            enemies.Add(new Enemy(1288, 56, Resources.Zombie));
            enemies.Add(new Enemy(1188, 56, Resources.Zombie));
            enemies.Add(new Enemy(1388, 56, Resources.Zombie));
            enemies.Add(new Enemy(1150, 180, Resources.Zombie));
            enemies.Add(new Enemy(1150, 180, Resources.Zombie));
            enemies.Add(new Enemy(1088, 260, Resources.Zombie));
            enemies.Add(new Enemy(1302, 300, Resources.Zombie));
            enemies.Add(new Enemy(1302, 300, Resources.Zombie));
            enemies.Add(new Enemy(1150, 340, Resources.Zombie));

            Walls.Add(new Wall(240, 400, Resources.Platform, 100, 16, Color.White));
            Walls.Add(new Wall(340, 330, Resources.Platform, 100, 16, Color.White));
            Walls.Add(new Wall(490, 380, Resources.Platform, 100, 16, Color.White));
            Walls.Add(new Wall(1088, 96, Resources.Platform, 450, 16, Color.White));
            Walls.Add(new Wall(1150, 180, Resources.Platform, 450, 16, Color.White));
            Walls.Add(new Wall(1088, 260, Resources.Platform, 450, 16, Color.White));
            Walls.Add(new Wall(1150, 340, Resources.Platform, 450, 16, Color.White));
            Walls.Add(new Wall(2440, 340, Resources.Platform, 50, 16, Color.White));
            Walls.Add(new Wall(2500, 280, Resources.Platform, 50, 16, Color.White));
            Walls.Add(new Wall(2580, 220, Resources.Platform, 50, 16, Color.White));
            Walls.Add(new Wall(2640, 160, Resources.Platform, 240, 16, Color.White));

            Walls.Add(new Wall(768, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(768, 352, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(832, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(832, 352, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(832, 288, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(896, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(896, 352, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(896, 288, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(896, 224, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(960, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(960, 352, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(960, 288, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(960, 224, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(960, 160, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1024, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1024, 352, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1024, 288, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1024, 224, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1024, 160, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1024, 96, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1600, 288, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1600, 224, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1600, 160, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1600, 96, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1600, 32, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1600, -32, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1920, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1984, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(2112, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(2176, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(2240, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1920, 352, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(1984, 352, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(2112, 352, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(2176, 352, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(2240, 352, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(2880, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(2880, 352, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(2880, 288, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(2880, 224, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(2880, 160, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(2880, 64, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(2880, 0, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3200, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3200, 352, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3328, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3328, 352, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3328, 288, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3456, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3456, 352, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3456, 288, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3456, 224, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3584, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3584, 352, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3584, 288, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3584, 224, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3584, 160, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3712, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3712, 352, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3712, 288, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3712, 224, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3712, 160, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3712, 96, Resources.Herbe_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3904, 416, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3904, 352, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3904, 288, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3904, 224, Resources.Terre_neige, 64, 64, Color.White));
            Walls.Add(new Wall(3904, 160, Resources.Herbe_neige, 64, 64, Color.White));

            for (int i = 0; i < 80; i++)
                if (i != 3 & i != 4 & i != 5 & i != 6 & i != 7 & i != 8 & i != 9
                           & i != 12 & i != 13 & i != 14 & i != 15 & i != 16 & i != 27 & i != 28
                           & i != 30 & i != 31 & i != 32 & i != 33 & i != 34 & i != 35 & i != 45
                           & i != 50 & i != 51 & i != 52 & i != 53 & i != 54 & i != 55 & i != 56 & i != 57 & i != 58 & i != 59 & i != 60 & i != 61 & i != 62 & i != 63)
                    Walls.Add(new Wall(64 * i, 416, Resources.Herbe_neige, 64, 64, Color.White));
        }
Example #15
0
        // CONSTRUCTOR
        public GameMain6()
        {
            menu = new MainMenu(Global.Handler, 0f);
            LocalPlayer = new Player();
            Walls = new List<Wall>();
            bonus = new List<Bonus>();
            healthbonus = new List<HealthBonus>();
            speedbonus = new List<VitesseBonus>();
            enemies = new List<Enemy>();
            enemies2 = new List<Enemy2>();
            boss = new List<Boss>();
            flames = new List<Flames>();
            piques = new List<Piques>();
            framecolumn = 1;

            Global.GameMain6 = this;

            for (int i = 0; i < 10; i++)
            {
                larg = random.Next(0, 4600);
                haut = random.Next(-2000, 0);
                flames.Add(new Flames(larg, haut));
            }

            piques.Add(new Piques(128, 425, Resources.Lave, 64, 64, Color.White));
            piques.Add(new Piques(192, 425, Resources.Lave, 64, 64, Color.White));
            piques.Add(new Piques(320, 425, Resources.Lave, 64, 64, Color.White));
            piques.Add(new Piques(384, 425, Resources.Lave, 64, 64, Color.White));
            piques.Add(new Piques(1024, 425, Resources.Lave, 64, 64, Color.White));
            piques.Add(new Piques(1152, 425, Resources.Lave, 64, 64, Color.White));

            for (int x = 0; x < map.GetLength(1); x++)
            {
                for (int y = 0; y < map.GetLength(0); y++)
                {
                    int number = map[y, x];
                    if (number == 1)
                        Walls.Add(new Wall(x * size, y * size + size / 2, Resources.Rock_top, size, size, Color.White));
                    if (number == 2)
                        Walls.Add(new Wall(x * size, y * size + size / 2, Resources.Rock, size, size, Color.White));
                    if (number == 3)
                        enemies.Add(new Enemy(x * size, y * size, Resources.Zombie));
                    if (number == 4)
                        enemies2.Add(new Enemy2(x * size, y * size, Resources.Elite));
                    if (number == 5)
                        bonus.Add(new Bonus(x * size, y * size, Resources.Coin, 20, 20, Color.White));
                    if (number == 6)
                        healthbonus.Add(new HealthBonus(x * size + 40, y * size + 74, Resources.Health, 20, 20, Color.White));
                    if (number == 7)
                        speedbonus.Add(new VitesseBonus(x * size + 40, y * size + 74, Resources.Speed, 20, 20, Color.White));
                    if (number == 8)
                        Walls.Add(new Wall(x * size, y * size + size / 2, Resources.Platform, 100, 16, Color.OrangeRed));

                }
            }

            #region Ennemis

            boss.Add(new Boss(3600, 300, Resources.Boss));

            #endregion

            #region Plateformes
            //Plateformes

            //Walls.Add(new Wall(425, 245, Resources.Platform, 50, 16, Color.IndianRed));

            #endregion

            #region Terrain
            //Colonnes et sol

            TheWall = new Wall(4544, 352, Resources.Rock, 64, 64, Color.White);
            Walls.Add(TheWall);

            //Sol

            for (int i = 0; i < 80; i++)
                if (i != 2 & i != 3 & i != 5 & i != 6 & i != 16 & i != 18 & i != 21 & i != 22 & i != 23 & i != 24 & i != 25 & i != 20 & i != 71)
                    Walls.Add(new Wall(64 * i, 416, Resources.Rock_top, 64, 64, Color.White));
            #endregion

            #region Bonus

            #endregion
        }