← All work

Feature·chetannihith/proj-hacktoberfest25

Add a Pygame Pong project with paddle controls and scoring

Introduces a Python Pong project using Pygame. The visible implementation sets up an 800×600 window and implements horizontal paddle controls, ball movement, and score updates.

The problem

The addition provides a standalone paddle-and-ball game project. Its core mechanics require keyboard-driven paddle movement, boundary handling, and detection of paddle hits and missed returns.

The approach

Initializes Pygame and processes left/right key events to update paddle velocity in a main loop. Updates ball coordinates and reverses velocity at side and top boundaries, with a coordinate-based paddle collision check that increments the score. Resets the score and reverses vertical velocity when the ball passes below the window; a paddle drawing helper clamps its rendered horizontal position.

What changed

Adds pong.io/main.py and a brief README. The visible code implements game state and interaction logic, but the truncated diff does not show the complete rendering or frame-timing implementation.

  • python
  • pygame
  • pong
  • game-development
  • keyboard-input