Skip to content

🎨 Palette: [Mario Game] Keyboard control refinement and a11y improvements#108

Open
EiJackGH wants to merge 1 commit intomainfrom
palette-mario-game-ux-14150505555651676540
Open

🎨 Palette: [Mario Game] Keyboard control refinement and a11y improvements#108
EiJackGH wants to merge 1 commit intomainfrom
palette-mario-game-ux-14150505555651676540

Conversation

@EiJackGH
Copy link
Owner

💡 What:
Added a clear visual instruction for gameplay ("Press Space to jump"), limited jumping input to Space and ArrowUp keys, prevented default page scrolling when using these keys, and added aria-live="polite" to the score element.

🎯 Why:

  • Users didn't know which keys to press to play the game.
  • If the game was embedded in a scrollable page, pressing Space or ArrowUp to jump would also scroll the browser window down, ruining the gameplay experience.
  • Screen readers were not naturally announcing the dynamic score updates.

📸 Before/After:
Before: No visual hint, jumping on any key, page scrolls on Space.
After: See screenshot for visual hint; jumping limited to specific keys and page scrolling is blocked.

♿ Accessibility:

  • Added aria-live="polite" to the #score element so screen readers will read out the score changes organically.
  • Prevented keyboard interaction from breaking focus/viewport position by preventing default browser scrolling.

PR created automatically by Jules for task 14150505555651676540 started by @EiJackGH

- Added a visual keyboard hint ("Press Space to jump").
- Refined the `keydown` event listener to strictly trigger on `Space` or `ArrowUp` (previously any key).
- Added `e.preventDefault()` for those keys to prevent the browser from naturally scrolling the page during gameplay.
- Added `aria-live="polite"` to the score container for screen readers.

Co-authored-by: EiJackGH <172181576+EiJackGH@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant