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.
When the game first starts, an overlay is shown with instructions describing the controls. This was previously purely text-based.
Add assets for the controls from the Kenney Input Prompts pack https://kenney.nl/assets/input-prompts (CC-0): arrow keys, W A S D, and joypad buttons, for which I chose the Steam Deck assets which are reasonably generic.
Rework the HUD to lay out the controls in a grid. Pack the keyboard images and controller images into a TabContainer (with the tabs hidden) which can be used to switch between the two sets of controls. Monitor the Input.joy_connection_changed signal to switch between the two sets of images based on the corresponding controller being connecter or disconnected. This signal is emitted at the start of the game for each connected controller, so we can default to the keyboard tab in each case.
It might be nice to detect whether the touch controls are visible and hide the control overlay in that case. This can be done by checking DisplayServer.is_touchscreen_available(), which is what the touch buttons use too. But this isn't a regression: we previously showed keyboard controls even when touch controls were visible.
It might also be nice to only show the player two controls if there is a player two. But again this is not a regression.
Before
After