This game is a modern take on the classic Pong game, featuring multiple game modes and enhanced mechanics. Developed in Unity, the project integrates class concepts such as interactive menus, sound effects, multiplayer gameplay, and AI-based paddle movement, all implemented using custom C# scripts.
- Interactive Start Screen:
- Includes background music.
- Features 3 buttons:
- Human vs Human: Starts a multiplayer game.
- Human vs Machine: Starts a game against an AI opponent.
- Start!: Launches the selected game mode.
- The menu seamlessly manages the transitions between the game modes and reactivates the menu after a game ends.
- Plays a sound whenever the player loses a point.
- The ball's speed increases by 10% every time the player loses a point.
- Adds the following features on top of solo mode:
- Interface:
- Displays scores for both players.
- Each player controls their paddle:
- Left Paddle: Controlled using
W(up) andS(down). - Right Paddle: Controlled using
O(up) andL(down).
- Left Paddle: Controlled using
- Scoring System:
- Each player's score starts at zero.
- A point is awarded to a player when the ball crosses their opponent's side.
- The ball resets direction towards the losing player after a score.
- The game ends when a player reaches the maximum score (configurable with
pointageMaximal). - Once the game ends, the menu screen is reactivated.
- Interface:
- Extends the multiplayer mode with the following:
- The left paddle is controlled by a basic AI system:
- The paddle automatically adjusts its vertical position to follow the ball.
- The right paddle is controlled by the player using:
Wto move up.Sto move down.
- The left paddle is controlled by a basic AI system:
- Background music for different game states (menu and gameplay).
- Sound effects trigger based on specific game events, like scoring or collisions.
-
Main Menu:
- Navigate the menu using the mouse.
- Click buttons to start a selected game mode.
-
Solo Mode:
- Use
Wto move the paddle up. - Use
Sto move the paddle down.
- Use
-
Multiplayer Mode (Human vs Human):
- Player 1 (Left Paddle):
- Use
Wto move the paddle up. - Use
Sto move the paddle down.
- Use
- Player 2 (Right Paddle):
- Use
Oto move the paddle up. - Use
Lto move the paddle down.
- Use
- Player 1 (Left Paddle):
-
Human vs AI Mode:
- The right paddle is controlled using
WandS(as in solo mode). - The left paddle moves automatically based on the ball's position.
- The right paddle is controlled using
- Main Menu Management:
- Handles transitions between the main menu and gameplay modes.
- Game Logic:
- Implements scoring, game restarts, and ball speed adjustments.
- Paddle Controls:
- Custom scripts manage paddle movement for both players and the AI.
- Audio Management:
- Scripts handle background music and sound effects, syncing them with gameplay events.
- Unity Version:
LTS 2022.3.40f1 - Free or personally created assets (no copyrighted media).
-
Clone the repository:
git clone https://github.com/yonahcodes/Pong.git
-
Install Prerequisites:
- Download and install
Unity Hubfrom the official Unity website - Install Unity version
LTS 2022.3.40f1through Unity Hub - Ensure you have a graphics card driver that supports Unity's requirements
- Download and install
-
Opening the Project:
- Launch Unity Hub
- Click
Addand browse to the cloned repository folder - Select the project folder and open it in Unity Editor
