Skip to content

A simple Pong game built using JavaScript, where Player 1 is controlled by an AI/Computer opponent and Player 2 is controlled by the user.

Notifications You must be signed in to change notification settings

Luk30lende/Pong-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pong Game (Player vs AI)

A simple Pong game built using JavaScript, where Player 1 is controlled by an AI opponent and Player 2 is controlled by the user.

Features

  • AI-controlled Player 1 with basic movement logic
  • Player 2 controlled using ArrowUp and ArrowDown keys
  • Collision detection for ball and paddles
  • Score tracking for both players
  • Game resets when the ball goes out of bounds
  • Dotted center line for aesthetics

Controls

  • Player 2:
    • Move up: ArrowUp
    • Move down: ArrowDown
  • Player 1 (AI): Moves automatically based on the ball's position

How to Play

  1. Clone the repository:
    git clone <repository-url>
  2. Open index.html in a browser.
  3. Use the arrow keys to move Player 2's paddle and try to score against the AI opponent.
  4. The game ends when a player reaches the score limit.

Technologies Used

  • HTML5 Canvas
  • JavaScript

Future Improvements

  • Improve AI difficulty levels
  • Add sound effects
  • Mobile responsiveness
  • Enhanced UI/UX

License

This project is licensed under the MIT License.

About

A simple Pong game built using JavaScript, where Player 1 is controlled by an AI/Computer opponent and Player 2 is controlled by the user.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published