Akki-jaiswal / Akki-jaiswal/pong-game

Add UI support for Restart and Quit functionality

Open
#126 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
22
Forks
116
PR merge metrics
No merged PRs in 30d

Description

The current pong game doesn't include any on-screen options to restart or quit. Users have to manually refresh the browser or close the tab to restart the game, which isn't ideal.

Proposed Enhancements:
Restart Button

Add a button labeled Restart that resets the game state (score, ball position, paddle positions) and starts a new game without reloading the page.

Quit Button

Add a Quit or Exit button that stops the game loop and optionally shows a “Game Over” or “Thanks for playing!” screen.

Implementation Ideas:
Use HTML elements styled with CSS, or draw custom buttons directly on the canvas.

Attach onclick event listeners to trigger a game reset or stop the animation loop.

For “Quit”, consider pausing the game and showing a message overlay instead of just closing the window (since browsers don't allow scripts to close tabs easily).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.