protected override void Update(GameTime gameTime) { keyboardState = keyboardManager.GetState(); mouseState = mouseManager.GetState(); // Handle base.Update base.Update(gameTime); //Update game objects lightsource.Update(gameTime); model.Update(gameTime, lightsource.getLightDirection()); water.Update(gameTime, lightsource.getLightDirection()); camera.Update(gameTime); //Enable/disable cursor control of the camera if (keyboardState.IsKeyPressed(Keys.Space)) { if (enableCursor == true) { enableCursor = false; } else { enableCursor = true; } } //Exit the game if (keyboardState.IsKeyDown(Keys.Escape)) { this.Exit(); this.Dispose(); } }
protected override void Update(GameTime gameTime) { // Getting input device states keyboardState = keyboardManager.GetState(); mouseState = mouseManager.GetState(); if (keyboardState.IsKeyDown(Keys.Escape)) { this.Exit(); } model.Update(gameTime); camera.Update(gameTime); // Handle base.Update base.Update(gameTime); }