Exemplo n.º 1
0
        public override void LoadContent(Microsoft.Xna.Framework.Content.ContentManager content)
        {
            base.LoadContent(content);

            BlockData.Initialize(Device, content);

            cam = new FirstPersonCamera(0.5f, 10);
            cam.Pos = new Vector3(3, 3, 13);


            map = new Map(Device);

            partition = new MapPartition(map);
            engine = new PhysicsEngine3D(partition);

            MeshBuilder mb = new MeshBuilder(Device);
            sphere = mb.CreateSphere(0.1f, 10, 10);
            marker = new MeshNode(sphere);

            placeType = 1;

            primBatch = new PrimitiveBatch(Device);


        }
Exemplo n.º 2
0
        public override void LoadContent(Microsoft.Xna.Framework.Content.ContentManager content)
        {
            base.LoadContent(content);

            BlockData.Initialize(Device, content);

            //map = new Map(Device, "Content/Levels/ramps.txt"); //Load map
            map = new Map(Device, "Content/Levels/Level1-1.txt");

            MeshBuilder mb = new MeshBuilder(Device);

            buildWalls(mb, content);

            setupNormalMapEffect(content);

            if (singleplayer)
            {
                objectiveLocation = map.getNextObjective(new Vector3(-1, -1, -1)); //get first objective
            }

            partition = new MapPartition(map);

            player = new Player(new Vector3(map.Width/2,20,map.Depth - 2)); //spawn player

            initializePhysicsEngine();

            //Misc initialization stuff
            sphere = mb.CreateSphere(1f, 10, 10);
            destination = mb.CreateSphere(0.5f, 12, 12); //sphere to draw at objective
            destination.Texture = content.Load<Texture2D>("Textures/BlockTextures/Destination");

            sBatch = new SpriteBatch(Device);
            sf = content.Load<SpriteFont>("Fonts/Helvetica");
            primBatch = new PrimitiveBatch(Device);

            playerColor = new Vector3((int.Parse(localPlayerName) % 5) / 5.0f, (int.Parse(localPlayerName) % 3) / 3.0f, (int.Parse(localPlayerName) % 2) / 2.0f);
        }