A Python simulation that demonstrates a robot navigating a screen while avoiding obstacles. This project is a simple and fun example of game development using the Pygame library.
- A moving robot (represented as a blue circle).
- Obstacles (red rectangles) that the robot avoids.
- Random direction changes when the robot collides with obstacles or boundaries.
- Smooth frame updates for a seamless experience.
- Python 3.10+
- Pygame library
- Python Installed: Make sure you have Python 3.10 or above installed.
- Pygame Library: Install Pygame using pip:
pip install pygame
Expected Behavior The robot moves continuously across the screen. When it collides with obstacles or screen edges, it changes its direction randomly. Obstacles remain stationary.
Customization Options Change Robot Speed: Modify robot_speed to adjust the robot's speed. Add More Obstacles: Increase or decrease num_obstacles to change the number of obstacles. Resize the Screen: Adjust WIDTH and HEIGHT for a different screen size.