Skip to content

๐Ÿ“ Welcome to the ultimate Ping Pong game built in Java! Get ready for fast-paced, addictive gameplay with smooth controls and exciting sound effects!

License

Notifications You must be signed in to change notification settings

andredisa/PingPong_vSimple-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

29 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“ Ping Pong Game ๐ŸŽฎ

Welcome to the ultimate Ping Pong game built in Java! Get ready for fast-paced, addictive gameplay with smooth controls and exciting sound effects! ๐ŸŽ‰


๐Ÿš€ About the Game

This classic Ping Pong game brings the retro arcade feel straight to your desktop!
Control your racket ๐Ÿ“, bounce the ball ๐ŸŽพ, and compete against a friend or the CPU ๐Ÿค–.
The game speeds up as you play, making every rally more thrilling! โšก


โœจ Features

  • ๐Ÿ•น๏ธ Smooth & responsive controls โ€” Player 1 uses W/S, Player 2 uses โฌ†๏ธ/โฌ‡๏ธ.
  • ๐Ÿค– CPU Mode โ€” Press C to challenge a smart AI opponent for solo matches.
  • โšก Dynamic ball speed โ€” The ball accelerates with each paddle hit, pushing your reflexes to the limit!
  • ๐Ÿ”Š Retro sound effects โ€” Classic bounce and score sounds bring that nostalgic arcade feeling.
  • ๐ŸŒˆ Neon arcade-style UI โ€” Glowing center line, paddle-displayed scores, and a vibrant, retro look.
  • ๐Ÿ Game Over & Restart โ€” First to 5 points wins! Press R to restart anytime.

๐ŸŽฎ How to Play

  1. Launch the game by running Main.java
  2. Press ENTER to start from the menu
  3. Use your controls to move your racket up and down
  4. Bounce the ball past your opponentโ€™s racket to score!
  5. First player to reach 5 points wins the match ๐Ÿ†
  6. Press R to restart after the game ends
  7. Toggle CPU mode anytime by pressing C

๐Ÿ“– How it Works

  • The Ball class manages position, movement, and speed increase.
  • The Racket class handles player or CPU paddle movement and scoring.
  • The main game loop uses a Timer for smooth animations and updates.
  • Key listeners track continuous paddle movement for fluid control.
  • Sound playback is threaded to prevent lag and keep gameplay buttery smooth.

๐Ÿ› ๏ธSetup

Ready to jump into the action? Just follow these easy steps! ๐Ÿ‘‡

  1. Clone the repository
    Open your terminal and type:
git clone https://github.com/andredisa/PingPong_vSimple-java.git
  1. Navigate to the project folder
cd PingPong_vSimple-java/src
  1. Compile the source code

Make sure you have Java installed, then run:

javac *.java
  1. Run the game

Launch the game with:

java Main
  1. Start playing!

Press ENTER to start, and enjoy your Ping Pong battle! ๐Ÿ“๐Ÿ”ฅ


๐Ÿ“‚ Project Structure

PingPong_vSimple-java/
โ”œโ”€โ”€ src/                    # ๐Ÿ’ป Source code files
โ”‚   โ”œโ”€โ”€ Main.java           # ๐ŸŽฎ Main game loop and rendering
โ”‚   โ”œโ”€โ”€ Ball.java           # ๐ŸŽพ Ball logic and movement
โ”‚   โ”œโ”€โ”€ Racket.java         # ๐Ÿ“ Player and CPU paddles
โ”‚   โ””โ”€โ”€ SoundPlayer.java    # ๐Ÿ”Š Sound effects handler
โ”œโ”€โ”€ sounds/                 # ๐ŸŽต Audio files for game effects
โ”‚   โ”œโ”€โ”€ bounce.wav          # ๐Ÿ”” Bounce sound effect
โ”‚   โ””โ”€โ”€ score.wav           # ๐Ÿฅณ Score sound effect
|
โ”œโ”€โ”€ README.md               # ๐Ÿ“– Project documentation and instructions
โ””โ”€โ”€ LICENSE                 # ๐Ÿ“œ License information


๐ŸŽ‰ Try it Out!

Feel free to fork or clone this repo and start smashing that ball around!
Perfect for learning Java GUI programming and having fun! ๐Ÿ˜„


๐Ÿ“ฃ Feedback & Contributions

Suggestions, improvements, or just want to chat about Pong?
Open an issue or drop a message! We love community โค๏ธ


๐Ÿ“ License

This project is open-source and free to use. Enjoy! ๐Ÿš€


โ˜• Support Me

If you find my work useful and would like to support me, you can buy me a coffee! Your support helps me keep creating and improving my projects. Thank you! ๐Ÿ˜Š

Buy Me A Coffee


LETโ€™S PING, LETโ€™S PONG! ๐Ÿ“๐Ÿ”ฅ

About

๐Ÿ“ Welcome to the ultimate Ping Pong game built in Java! Get ready for fast-paced, addictive gameplay with smooth controls and exciting sound effects!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages