Implement keyboard capture #21
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This addresses issue #19. However, main.ts is getting quite unweildy with spaghetti state management. In addition, there is a conceptual issue becoming clear between game-rendered input prompts and DOM-level input prompts. E.g. in the game-over state, the game renders the message "Space to restart," but now that only works if the game is not "paused," aka input is being captured. As another example, the hotkeys identified by the game-mode checkbox labels only work when input is captured, but that's not clear from looking at them.
The plan for the state management issue is to rewrite the UI in React, which will be the next bit of work.
I'm not sure OTTOMH what to do about the conceptual issue, but I think clarifying state management may help in thinking it through.