Exemplo n.º 1
0
        protected override void Initialize()
        {
            camera = new Camera(this, new Vector3(0, 30, 0), Vector3.Zero);
            camera.Initialize();

            ArcheryGame.Services.Initialize(this, GraphicsDevice, camera);

            terrain = new TerrainGenerator(this, "sand", "grass", "stone", "heightmap4");
            terrain.Initialize();
            terrain.GenerateWall();

            archer = new Archer(this, new Vector3(15, 30, -15), Vector3.Zero, 10, terrain);
            archer.Initialize();

            sky = new Skydome(this);
            sky.Initialize();

            target = new Target(this, new Vector3(20, 15, -20));
            target.Initialize();

            effect = new BasicEffect(graphics.GraphicsDevice);

            projectionMatrix = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45f), graphics.GraphicsDevice.Viewport.AspectRatio, 1f, 1000f);
            viewMatrix       = camera.View;
            worldMatrix      = Matrix.Identity;

            base.Initialize();
        }