Welcome to the ultimate Ping Pong game built in Java! Get ready for fast-paced, addictive gameplay with smooth controls and exciting sound effects! 🎉
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! ⚡
- 🕹️ Smooth & responsive controls — Player 1 uses
W/S, Player 2 uses⬆️/⬇️. - 🤖 CPU Mode — Press
Cto 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
Rto restart anytime.
- Launch the game by running
Main.java - Press ENTER to start from the menu
- Use your controls to move your racket up and down
- Bounce the ball past your opponent’s racket to score!
- First player to reach 5 points wins the match 🏆
- Press R to restart after the game ends
- Toggle CPU mode anytime by pressing C
- 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
Timerfor 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.
Ready to jump into the action? Just follow these easy steps! 👇
- Clone the repository
Open your terminal and type:
git clone https://github.com/andredisa/PingPong_vSimple-java.git- Navigate to the project folder
cd PingPong_vSimple-java/src- Compile the source code
Make sure you have Java installed, then run:
javac *.java- Run the game
Launch the game with:
java Main- Start playing!
Press ENTER to start, and enjoy your Ping Pong battle! 🏓🔥
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
Feel free to fork or clone this repo and start smashing that ball around!
Perfect for learning Java GUI programming and having fun! 😄
Suggestions, improvements, or just want to chat about Pong?
Open an issue or drop a message! We love community ❤️
This project is open-source and free to use. Enjoy! 🚀
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! 😊


