示例#1
0
        /// <summary>
        /// Allows the game component to update itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public override void Update(GameTime gameTime)
        {
            ICamera camera = (ICamera)Game.Services.GetService(typeof(ICamera));

            Matrix objectMatrix = Matrix.CreateRotationX(0) * Matrix.CreateRotationY(0) * Matrix.CreateTranslation(0.0f, 155.0f, 0.0f);
            Matrix renderMatrix = Matrix.CreateScale(0.0080f);

            renderMatrix = objectMatrix * renderMatrix;

            castle0.Update(gameTime, renderMatrix, camera.ViewMatrix, camera.ProjectionMatrix);
            castle1.Update(gameTime, renderMatrix, camera.ViewMatrix, camera.ProjectionMatrix);
            castle2.Update(gameTime, renderMatrix, camera.ViewMatrix, camera.ProjectionMatrix);
            castle3.Update(gameTime, renderMatrix, camera.ViewMatrix, camera.ProjectionMatrix);
            castle4.Update(gameTime, renderMatrix, camera.ViewMatrix, camera.ProjectionMatrix);
            castle5.Update(gameTime, renderMatrix, camera.ViewMatrix, camera.ProjectionMatrix);

            base.Update(gameTime);
        }
        /// <summary>
        /// Allows the game component to update itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public override void Update(GameTime gameTime)
        {
            ICamera camera = (ICamera)Game.Services.GetService(typeof(ICamera));

            Matrix objectMatrix = Matrix.CreateRotationX(0) * Matrix.CreateRotationY(0) * Matrix.CreateTranslation(0.0f, 0.0f, 0.0f);
            Matrix renderMatrix = Matrix.CreateScale(0.0080f);

            renderMatrix = objectMatrix * renderMatrix;

            theGround.Update(gameTime, renderMatrix, camera.ViewMatrix, camera.ProjectionMatrix);
            theRiver.Update(gameTime, renderMatrix, camera.ViewMatrix, camera.ProjectionMatrix);

            objectMatrix = Matrix.CreateRotationX(0) * Matrix.CreateRotationY(0) * Matrix.CreateTranslation(0.0f, 50.0f, 0.0f);
            renderMatrix = Matrix.CreateScale(0.0080f);
            renderMatrix = objectMatrix * renderMatrix;
            theTrees.Update(gameTime, renderMatrix, camera.ViewMatrix, camera.ProjectionMatrix);
            theShrooms.Update(gameTime, renderMatrix, camera.ViewMatrix, camera.ProjectionMatrix);

            base.Update(gameTime);
        }