# HG changeset patch # User Alys Brooks # Date 2021-06-09 03:40:25 # Node ID 8a5e5f13408d37de12571a7b18f98a253b3529b5 # Parent ef4cf82fdfe0692638a8734d2809e106101e5d77 Pull out input from FNAGame. diff --git a/isometric-park-fna/Engines/InputEngine.cs b/isometric-park-fna/Engines/InputEngine.cs --- a/isometric-park-fna/Engines/InputEngine.cs +++ b/isometric-park-fna/Engines/InputEngine.cs @@ -20,7 +20,8 @@ typeof(ToggleWindowMessage), //??? typeof(ToggleVisibilityMessage), typeof(TogglePauseMessage), - typeof(GameRateMessage))] + typeof(GameRateMessage), + typeof(GameStateMessage))] [Reads(typeof(WindowTypeComponent), typeof(VisibilityComponent))] public class InputEngine : Engine @@ -172,6 +173,14 @@ } #endif +#if DEBUG + + if (keyboardCur.IsKeyDown(Keys.A) && keyboardPrev.IsKeyUp(Keys.A)) + { + SendMessage(new GameStateMessage {isPlaying = false}); + } +#endif + if (keyboardCur.IsKeyDown(Keys.Q) && keyboardPrev.IsKeyUp(Keys.Q)) { System.Console.WriteLine("Quitting"); diff --git a/isometric-park-fna/FNAGame.cs b/isometric-park-fna/FNAGame.cs --- a/isometric-park-fna/FNAGame.cs +++ b/isometric-park-fna/FNAGame.cs @@ -479,17 +479,9 @@ { sound.Play(volume, pitch, pan); } - if (keyboardCur.IsKeyDown(Keys.A) && keyboardPrev.IsKeyUp(Keys.A)) - { - this.isPlaying = !this.isPlaying; - } #endregion misc_keys -// - #endregion input - - World.Update(gameTime.ElapsedGameTime.TotalSeconds); this.simulation.update(gameTime.ElapsedGameTime);