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
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.
- 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
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.
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! ๐