You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Keyboard input causes weirdness like making the mouse pointer flicker, or highlighting text on the page when using Shift + arrows.
Have a global mode switch so either (1) the game is fully capturing keyboard (and keyboard event handlers use preventDefault() and stopPropagation()), or (2) the game is not receiving keyboard input at all. A button or checkbox in the UI controls this. Or maybe you can just click on the Canvas too.
Keyboard users can hit ESC to stop capturing?
The page gives a visual indicator for the mode.
Also, use hotkeys for mode toggles. Maybe numbers? Will it be okay to limit myself to 10 modes? ... 😁
The text was updated successfully, but these errors were encountered:
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.
Keyboard input causes weirdness like making the mouse pointer flicker, or highlighting text on the page when using Shift + arrows.
preventDefault()
andstopPropagation()
), or (2) the game is not receiving keyboard input at all. A button or checkbox in the UI controls this. Or maybe you can just click on the Canvas too.The text was updated successfully, but these errors were encountered: