예제 #1
0
        // Add() components
        public override void Initialize()
        {
            Scale = new Vector2((float)Jeu.Window.ClientBounds.Width / RÉSOLUTION_PAR_DÉFAUT_X, (float)Jeu.Window.ClientBounds.Height / RÉSOLUTION_PAR_DÉFAUT_Y);
            Vector3 positionCaméra = new Vector3(300, 70, -10);

            TexturesSkybox = new List <string[]>();
            string[] TexturesTerrain = new string[] { "Terrain\\Grass",
                                                      "Terrain\\Snow",
                                                      "Terrain\\Sand",
                                                      "Terrain\\Lava",
                                                      "Terrain\\Lava" };
            FogData[] fogData = new FogData[] { new FogData(new Vector3(0.7f, 1f, 0.8f), 30, 450),
                                                new FogData(new Vector3(0.3f, 0.3f, 0.35f), 30, 450),
                                                new FogData(new Vector3(1f, 0.8f, 0.1f), -200, 1500),
                                                new FogData(new Vector3(1f, 0.6f, 0.1f), 20, 450),
                                                new FogData(new Vector3(0.70f, 0.32f, 0.0f), 10, 420) };

            List <string> listNomMusic = new List <string>()
            {
                "m_act1", "m_act2", "m_act3", "m_act4", "m_act4"
            };


            TexturesSkybox.Add(new string[] { "DarkBox\\topdark",
                                              "DarkBox\\frontdark",
                                              "DarkBox\\backdark",
                                              "DarkBox\\leftdark",
                                              "DarkBox\\rightdark",
                                              "DarkBox\\botdark" });

            string[] SpellIcons = new string[] { "HUD\\Spells\\ChaosBoltButton",
                                                 "HUD\\Spells\\PlasmaFieldButton",
                                                 "HUD\\Spells\\SlowTimeButton",
                                                 "HUD\\Spells\\SpellstealButton" };

            string[] SpellIconsAlt = new string[] { null,
                                                    null,
                                                    "HUD\\Spells\\TimeLockButton",
                                                    null };

            string[] SpellTooltips = new string[] { "Content\\Text\\Firebolt.txt",
                                                    "Content\\Text\\Nova.txt",
                                                    "Content\\Text\\SlowMissiles.txt",
                                                    "Content\\Text\\MindControl.txt" };

            string[] SpellTooltipsAlt = new string[] { null,
                                                       null,
                                                       "Content\\Text\\SlowMissilesAlt.txt",
                                                       null };

            //Vector3 positionCaméra = new Vector3(0, 10, 0);

            GestionInput3D = new InputManager3D(Jeu, this);
            MapManager     = new TerrainManager(Jeu, this, NB_ZONES, new Vector2(ÉTENDUE_MAP, ÉTENDUE_MAP), TexturesTerrain, fogData, GestionnaireDeTextures.Find("Terrain\\heightmap3.0"), listNomMusic);
            BaldorLeBrave  = new Héros(Jeu, this, "dude", 0.2f, 1f,
                                       new Vector3(300, 0, -50), new Vector3(0, MathHelper.PiOver2, 0), new Vector3(0, -MathHelper.PiOver2, 0),
                                       "Baldor Le Brave",
                                       35f, MathHelper.Pi * 4, true,
                                       42, 18, 0, 5, 3, 0.8f,
                                       "nova");
            CaméraJeu = new CaméraThirdPerson(Jeu, GestionInput3D, positionCaméra, BaldorLeBrave, Vector3.Up);
            Box       = new Skybox(Jeu, this, "skybox2", TexturesSkybox[0], new Vector3(0, -1, 0));
            FinalBoss = new Boss(Jeu, this, BaldorLeBrave, "Cyclops\\terrorwurm", 0.2f, ÉCHELLE_BOX_WURM, new Vector3(ÉTENDUE_MAP / 2, 0, -ÉTENDUE_MAP * 4.6f), new Vector3(0, 0, 0), new Vector3(0, -MathHelper.PiOver2, 0), "Demon Grostesque", 30f, MathHelper.Pi * 4, false, 400, 3, 6, 4, 1f, false, 15, 70, 42, 0);

            HeadsUpDisplay   = new HUD(Jeu, this, BaldorLeBrave, "HUD\\HUD", "HUD\\Vie", "HUD\\Mana", "HUD\\Exp", 2.5f, SpellIcons, SpellIconsAlt, "HighTowerText", "HUD\\TextBackground", SpellTooltips, SpellTooltipsAlt);
            ProjManager      = new ProjectileManager(Jeu, this, "OrangeBall", 0.01f);
            MonstManager     = new MonsterManager(Jeu, this);
            CollisionManager = new CollisionManager(Jeu, this);
            BarresManager    = new HealthBarManager(Jeu, this, "HUD\\healthbar", "HUD\\healthbarbg", "Stroke");
            NovManager       = new NovaManager(Jeu, this);
            DoodManager      = new DoodadManager(Jeu, this);


            ListeDesÉléments.Add(GestionInput3D);
            ListeDesÉléments.Add(new Afficheur3D(Jeu));

            ListeDesÉléments.Add(CaméraJeu);
            ListeDesÉléments.Add(Box);
            ListeDesÉléments.Add(MapManager);

            ListeDesÉléments.Add(BaldorLeBrave);
            ListeDesÉléments.Add(MonstManager);

            ListeDesÉléments.Add(FinalBoss);
            ListeDesÉléments.Add(ProjManager);
            ListeDesÉléments.Add(NovManager);
            ListeDesÉléments.Add(DoodManager);
            ListeDesÉléments.Add(CollisionManager);
            ListeDesÉléments.Add(HeadsUpDisplay);
            //ListeDesÉléments.Add(ExpBar);
            ListeDesÉléments.Add(BarresManager);
            ListeDesÉléments.Add(new AfficheurFPS(Jeu, "Arial"));



            base.Initialize();


            CréerDoodads();
            CréerMonstres();
        }
예제 #2
0
        // Add() components
        public override void Initialize()
        {
            Scale = new Vector2((float)Jeu.Window.ClientBounds.Width / RÉSOLUTION_PAR_DÉFAUT_X, (float)Jeu.Window.ClientBounds.Height / RÉSOLUTION_PAR_DÉFAUT_Y);
            Vector3 positionCaméra = new Vector3(300, 70, -10);
            TexturesSkybox = new List<string[]>();
            string[] TexturesTerrain = new string[] {"Terrain\\Grass",
                                              "Terrain\\Snow",
                                              "Terrain\\Sand",
                                              "Terrain\\Lava",
                                              "Terrain\\Lava"};
               FogData[] fogData = new FogData[] {new FogData(new Vector3(0.7f, 1f, 0.8f), 30, 450),
                                              new FogData(new Vector3(0.3f, 0.3f, 0.35f), 30, 450),
                                              new FogData(new Vector3(1f, 0.8f, 0.1f), -200, 1500),
                                              new FogData(new Vector3(1f, 0.6f, 0.1f), 20, 450),
                                              new FogData(new Vector3(0.70f, 0.32f, 0.0f), 10, 420)};

            List<string> listNomMusic = new List<string>() { "m_act1", "m_act2", "m_act3", "m_act4", "m_act4" };

            TexturesSkybox.Add(new string[]{"DarkBox\\topdark",
                                              "DarkBox\\frontdark",
                                               "DarkBox\\backdark",
                                               "DarkBox\\leftdark",
                                               "DarkBox\\rightdark",
                                               "DarkBox\\botdark"} );

            string[] SpellIcons = new string[] {"HUD\\Spells\\ChaosBoltButton",
                                                      "HUD\\Spells\\PlasmaFieldButton",
                                                      "HUD\\Spells\\SlowTimeButton",
                                                      "HUD\\Spells\\SpellstealButton"};

            string[] SpellIconsAlt = new string[] {null,
                                                         null,
                                                         "HUD\\Spells\\TimeLockButton",
                                                         null};

            string[] SpellTooltips = new string[] {"Content\\Text\\Firebolt.txt",
                                                   "Content\\Text\\Nova.txt",
                                                   "Content\\Text\\SlowMissiles.txt",
                                                   "Content\\Text\\MindControl.txt"};

            string[] SpellTooltipsAlt = new string[] {null,
                                                      null,
                                                      "Content\\Text\\SlowMissilesAlt.txt",
                                                      null};

            //Vector3 positionCaméra = new Vector3(0, 10, 0);

            GestionInput3D = new InputManager3D(Jeu, this);
            MapManager = new TerrainManager(Jeu, this, NB_ZONES, new Vector2(ÉTENDUE_MAP, ÉTENDUE_MAP), TexturesTerrain, fogData, GestionnaireDeTextures.Find("Terrain\\heightmap3.0"), listNomMusic);
            BaldorLeBrave = new Héros(Jeu, this, "dude", 0.2f, 1f,
                                       new Vector3(300, 0, -50), new Vector3(0, MathHelper.PiOver2, 0), new Vector3(0, -MathHelper.PiOver2, 0),
                                       "Baldor Le Brave",
                                       35f, MathHelper.Pi * 4, true,
                                       42, 18, 0, 5, 3, 0.8f,
                                       "nova");
            CaméraJeu = new CaméraThirdPerson(Jeu, GestionInput3D, positionCaméra, BaldorLeBrave, Vector3.Up);
            Box = new Skybox(Jeu, this, "skybox2", TexturesSkybox[0], new Vector3(0,-1,0));
            FinalBoss = new Boss(Jeu, this, BaldorLeBrave, "Cyclops\\terrorwurm", 0.2f, ÉCHELLE_BOX_WURM, new Vector3(ÉTENDUE_MAP/2, 0, -ÉTENDUE_MAP*4.6f), new Vector3(0, 0, 0), new Vector3(0, -MathHelper.PiOver2, 0), "Demon Grostesque", 30f, MathHelper.Pi * 4, false, 400, 3, 6, 4, 1f, false, 15, 70, 42, 0);

            HeadsUpDisplay = new HUD(Jeu, this, BaldorLeBrave, "HUD\\HUD", "HUD\\Vie", "HUD\\Mana", "HUD\\Exp", 2.5f, SpellIcons, SpellIconsAlt, "HighTowerText", "HUD\\TextBackground", SpellTooltips, SpellTooltipsAlt);
            ProjManager = new ProjectileManager(Jeu, this, "OrangeBall", 0.01f);
            MonstManager = new MonsterManager(Jeu, this);
            CollisionManager = new CollisionManager(Jeu, this);
            BarresManager = new HealthBarManager(Jeu, this, "HUD\\healthbar", "HUD\\healthbarbg", "Stroke");
            NovManager = new NovaManager(Jeu, this);
            DoodManager = new DoodadManager (Jeu, this);

            ListeDesÉléments.Add(GestionInput3D);
            ListeDesÉléments.Add(new Afficheur3D(Jeu));

            ListeDesÉléments.Add(CaméraJeu);
            ListeDesÉléments.Add(Box);
            ListeDesÉléments.Add(MapManager);

            ListeDesÉléments.Add(BaldorLeBrave);
            ListeDesÉléments.Add(MonstManager);

            ListeDesÉléments.Add(FinalBoss);
            ListeDesÉléments.Add(ProjManager);
            ListeDesÉléments.Add(NovManager);
            ListeDesÉléments.Add(DoodManager);
            ListeDesÉléments.Add(CollisionManager);
            ListeDesÉléments.Add(HeadsUpDisplay);
            //ListeDesÉléments.Add(ExpBar);
            ListeDesÉléments.Add(BarresManager);
            ListeDesÉléments.Add(new AfficheurFPS(Jeu, "Arial"));

            base.Initialize();

            CréerDoodads();
            CréerMonstres();
        }