예제 #1
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
        }
예제 #2
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
        }