Skip to content

A simple web-based ping pong score game built with JavaScript, HTML, and CSS. Users can set a target score and track points for two players. The game automatically declares a winner or draw when the target score is reached and allows for easy resetting.

Notifications You must be signed in to change notification settings

justdeen/Ping-pong

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notes_241113_102514_efc

💫Overview

A lightweight JavaScript-powered ping pong score tracker with automatic winner detection and reset functionality. This game allows two players to track their scores and declare a winner based on a predetermined target score.

🪄Features

  1. Set a target score for the game
  2. Track scores for two players
  3. Automatically declare a winner when the target score is reached
  4. Reset game state with a single button click
  5. Responsive design for mobile and tablet devices

⚙️How the Code Works

The game uses JavaScript event listeners to update the scores and check for a winner. Here's a high-level breakdown:

  1. The game stores HTML elements in JavaScript variables for easy access.
  2. Global variables track the current score, target score, and player scores.
  3. Event listeners on the player buttons update scores and check for a winner.
  4. The winner is declared when the sum of both player scores reaches or exceeds the target score.

🌈User Interface

  1. Target Score: Select the target score from a dropdown menu.
  2. Player Scores: Displayed prominently on the screen.
  3. Player Buttons: Click to increment player scores.
  4. Reset Button: Reset game state to start a new game.
  5. Winner Display: Shows the winner or a draw message.

📦Technologies Used

  1. HTML5
  2. CSS3
  3. JavaScript (ES6+)

💡Contributing

Contributions are welcome! Fork the repository, make changes, and submit a pull request.

🥂Acknowledgments

  1. Font used: Nunito (Google Fonts)
  2. Inspired by classic Ping Pong games

About

A simple web-based ping pong score game built with JavaScript, HTML, and CSS. Users can set a target score and track points for two players. The game automatically declares a winner or draw when the target score is reached and allows for easy resetting.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published