Exemple #1
0
        private void InitializePhyics()
        {
            this.IsMouseVisible = false;
            world = new PhysicsSystem();
            world.CollisionSystem = new CollisionSystemSAP();
            world.Gravity         = new Vector3(0, -400, 0);

            intro introduction = new intro(this, "cloudMap");

            c1 = new Character(this, new Vector3(0, 650, 40), Vector3.One);

            _navMesh = new NavMesh(this, "navMesh");

            PistolGun  pistol  = new PistolGun(this, new Vector3(19, -15, 10));
            MachineGun machine = new MachineGun(this, new Vector3(20, -15, 20));
            Knife      knife   = new Knife(this, new Vector3(17, -15, 10));

            Overlay hud       = new Overlay(this, GraphicsDevice);
            Overlay crosshair = new Overlay(this, GraphicsDevice);

            boxtest b1 = new boxtest(this, "box", new Vector3(0, 10, 20), new Vector3(10, 10, 10), false);

            b1.TakesDamage = true;
            b1.CurLife     = 100;

            Room room = new Room(this, Vector3.Down * 63, Vector3.One);

            _camera            = new Camera(this, c1, 10.0f, 6 / 8f);
            _camera.Lookat     = c1.Body.Position;
            _camera.CameraMode = Camera.CameraModes.FIRST_PERSON;

            SkyDome sky = new SkyDome(this, "dome", "white", Vector3.Up * -150, new Vector3(390, 8500, 390));

            introduction.DrawOrder = 500;

            squid        s;
            BillBoarding billy = new BillBoarding(this, "explosionSpriteSheet", new Vector3(0, -40, 0), Vector2.One, new Vector2(5, 5), 50f);

            Components.Add(billy);

            for (int i = 0; i < 0; i++)
            {
                s = new squid(this, "cone2", new Vector3(r.Next(-500, 500), r.Next(0, 800), r.Next(-500, 500)), Vector3.One, 50, 50);
                Components.Add(s);
            }

            hud.DrawOrder       = 2;
            crosshair.DrawOrder = 2;
            Components.Add(_navMesh);
            Components.Add(introduction);
            Components.Add(_camera);
            Components.Add(sky);
            Components.Add(hud);
            Components.Add(crosshair);

            Components.Add(pistol);
            Components.Add(machine);
            Components.Add(knife);
            Components.Add(b1);
            Components.Add(c1);

            Components.Add(room);

            c1.PickUpWeapon(pistol);
            c1.PickUpWeapon(machine);
            c1.PickUpWeapon(knife);
        }
Exemple #2
0
        private void InitializePhyics()
        {
            this.IsMouseVisible = true;

            PhysicsSystem world = new PhysicsSystem();
            world.CollisionSystem = new CollisionSystemSAP();

            testBox = new boxtest(this, "box");
            fallBox = new boxtest(this, "box", new Vector3(0,50,0));

            _camera = new Camera(this, testBox, new Vector3(5.0f, 5.0f, 5.0f), 6/8f, 0.1f, 10000.0f);

            testBox.Body.Immovable = true;
            fallBox.Body.Immovable = false;

            Components.Add(testBox);
            Components.Add(fallBox);
            Components.Add(_camera);
        }