Exemple #1
0
 protected override void Update()
 {
     audio.Update();
     frameinfo.Update();
     vsc.Update(timer.ElapsedSeconds);
     //vscp.Update(timer.ElapsedSeconds);
 }
Exemple #2
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            Input.Update();
            frameinfo.Update();

            if (Input.IsKeyDown(Keys.Escape))
            {
                this.Exit();
            }
            if (Input.IsKeyDown(Keys.F2))
            {
                ToggleFullScreen();
            }

            if (Input.IsKeyDown(Keys.W))
            {
                model.Para.BasePara.center += Vector3.Forward * 0.02f;
                model.WorldMatrix           = Matrix.CreateTranslation(model.BasePara.center);
                audioemitter.Position       = model.BasePara.center;
            }
            if (Input.IsKeyDown(Keys.S))
            {
                model.Para.BasePara.center += Vector3.Backward * 0.02f;
                model.WorldMatrix           = Matrix.CreateTranslation(model.BasePara.center);
                audioemitter.Position       = model.BasePara.center;
            }
            if (Input.IsKeyDown(Keys.A))
            {
                model.Para.BasePara.center += Vector3.Left * 0.02f;
                model.WorldMatrix           = Matrix.CreateTranslation(model.BasePara.center);
                audioemitter.Position       = model.BasePara.center;
            }
            if (Input.IsKeyDown(Keys.D))
            {
                model.Para.BasePara.center += Vector3.Right * 0.02f;
                model.WorldMatrix           = Matrix.CreateTranslation(model.BasePara.center);
                audioemitter.Position       = model.BasePara.center;
            }

            model.Para.BasePara.orientation3D += model.BasePara.rotationspeed3D * (float)gameTime.ElapsedGameTime.TotalSeconds;
            model.Ori3DMatrix = VisionStimulus.GetOri3DMatrix(model.BasePara.orientation3D);

            if (audio.ActiveCue3Ds.Count > 0)
            {
                audio.ActiveCue3Ds[0].Emitter = audioemitter;
            }
            else
            {
                audio.Play("BgMusic", audioemitter);
            }
            audio.Update();

            base.Update(gameTime);
        }
Exemple #3
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            Input.Update();
            frameinfo.Update();

            if (Input.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Escape))
            {
                this.Exit();
            }
            if (Input.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.F2))
            {
                ToggleFullScreen();
            }

            base.Update(gameTime);
        }
Exemple #4
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            Input.Update();
            frameinfo.Update();
            audio.Update();
            vsc.Update(gameTime.TotalGameTime.TotalSeconds);

            if (Input.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Escape))
            {
                this.Exit();
            }
            if (Input.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.F2))
            {
                ToggleFullScreen();
            }
            if (Input.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.G))
            {
                SetGamma(new Vector3(2.1f, 2.1f, 2.1f));
            }

            base.Update(gameTime);
        }
Exemple #5
0
 protected override void Update()
 {
     audio.Update();
     frameinfo.Update();
 }