Example #1
0
        public override void OnAdd(Scene scene)
        {
            base.OnAdd(scene);

            camera = scene.MainPlayer;

            gun = new Weapon("Pistol", this.body, camera.Transformation, scene);
        }
Example #2
0
        public override void OnAdd(Scene scene)
        {
            base.OnAdd(scene);

            healthRechargeRate = 5;
            camera = (Camera)scene.FindEntity("MainCamera");
            weapons.Add(new Weapon("Machete", this.body, camera.Transformation, scene));
            weapons.Add(new Weapon("Pistol", this.body, camera.Transformation, scene));
            weapons.Add(new Weapon("SMG", this.body, camera.Transformation, scene));
            gun = weapons[weaponIndex];

            PlayerScreen.GetInst().AddJournalEntry("Get the key from the shack");
            PlayerScreen.GetInst().AddMarker(scene.FindEntity("Shack").Transformation);
        }
Example #3
0
        void InitializeScene()
        {
            ResetScene();

            Entities.Add("Sky", new Sky());
            MainLight = new Sunlight();
            MainTerrain = new TerrainVoxel();
            /*
            MainTerrain = new TerrainHeightmap("Textures/level1_hm.png", 0, 100.0f);
            float width = (MainTerrain as TerrainHeightmap).GetWidth();
            float height = (MainTerrain as TerrainHeightmap).MaximumHeight;
            MainTerrain.Transformation.SetScale(new Vector3(1, height / width, 1) * width);
            */

            MainPlayer = new Camera();

            Entities.Add("MainCamera", MainPlayer);
            Entities.Add("Terrain", MainTerrain);
            Entities.Add("Light", MainLight);
            Entities.Add("Plane", new Model("Plane"));
            Entities.Add("AmbientLight", new Light(LightType.Ambient, new Vector3(0.15f, 0.35f, 0.55f), Vector3.Zero, false));
            Entities.Add("TestTree", new Model("Palm02"));
            Entities["TestTree"].Transformation.SetPosition(Vector3.Forward * 10.0f);
            Entities.Add("TestTree2", new Model("JungleOverhang"));
            Entities["TestTree2"].Transformation.SetPosition(Vector3.Forward * 10.0f + Vector3.Right * 7.6f);

            //AddEntity("Grass", new GrassPlacement());
            AddEntity("Forest", new ForestManager());
            //CreateForest();

            //Entities.Add("Grass", new ShapePlacement());

            /*
            Model testGeom = new Model("test_level");
            testGeom.Transformation.SetPosition(Vector3.Up*20.0f);
            Entities.Add("scene_geom1", testGeom);

            Model testGeom2 = new Model("cgWarehouse002story");
            testGeom2.Transformation.SetPosition(Vector3.Up * 21.0f);
            Entities.Add("scene_geom2", testGeom2);
            */
            AnimatedModel model = new AnimatedModel("Allosaurus");

            model.Transformation.SetPosition(Vector3.Forward*10+Vector3.Up*68);
            model.Model.GetAnimationLayer().SetActiveAnimation("AllosaurusIdle", true);//.SetAnimationLayer("AllosaurusIdle", 1.0f);
            model.Model.SetCustomMatrix(Matrix.CreateScale(0.09f)*Matrix.CreateRotationX(-MathHelper.PiOver2));
            //model.UpdateAnimation();
            Entities.Add("TestCharacter", model);

            AnimatedModel model2 = new AnimatedModel("AlphaRaptor");

            model2.Transformation.SetPosition(Vector3.Forward * -5 + Vector3.Up * 62);
            model2.Model.GetAnimationLayer().SetActiveAnimation("AlphaRaptorIdle", true);//.SetAnimationLayer("AlphaRaptorIdle", 1.0f);
            model2.Model.SetCustomMatrix(Matrix.CreateScale(0.12f) * Matrix.CreateRotationX(-MathHelper.PiOver2));
            //model.UpdateAnimation();
            Entities.Add("TestCharacter2", model2);

            Raptor raptor = new Raptor(ResourceManager.Inst.GetDinosaurDatablock("Coelophysis"));
            Entities.Add("Raptor", raptor);

            Chest weaponCrate = new Chest("Weapon Box", "WeaponBox");
            weaponCrate.Transformation.SetPosition(Vector3.Up * 30.0f);
            Entities.Add("weaponCrate", weaponCrate);
            CreateTeams();

            //Entities.Add("Light2", new Light(LightType.Directional, new Vector3(0.2797f, 0.344f, 0.43f), Vector3.Up, false));

            Initialize();
        }