This project is an interactive Pygame simulation where a ball moves according to user input, and a "dog" (yellow square) chases it across the screen. The simulation demonstrates:
- Ball movement with slope and direction control
- Wall collisions and bouncing
- Dynamic chasing behavior of the dog
- Real-time detection of ball position across 4 circular sensor zones
This project is perfect for learning Pygame basics, vector math, and simple AI movement in games.
- π― Interactive Drag & Release: Click, drag, and release the ball to set its trajectory.
- π Chasing AI: The dog continuously moves toward the ball using normalized vectors.
- π‘ Zone Detection: The screen is divided into 4 zones, and the program prints which zone(s) the ball is in.
- β‘ Real-time Simulation: Smooth animation with bouncing and collision detection.
- πΌ Visualization: Includes a diagram showing zones and ball movement.
- Install dependencies:
pip install pygameEng. Khadija Bouadi
For any queries, reach out to:
GitHub: @khadibd
Email: khadibd00@gmail.com
