New-Empty-Python-Project-Base
New-Empty-Python-Project-Base copied to clipboard
I've added a Pygame script for a bouncing ball animation.
This script, bouncing_ball.py, creates a simple graphical animation:
- A ball moves and bounces off the edges of the Pygame window.
- Two green triangles representing trees are displayed on either side of the screen.
Features:
- Initializes Pygame and sets up an 800x600 display.
- Defines a
Ballclass to handle position, movement, and drawing of the ball. - Includes a
draw_treefunction to render simple triangular trees. - The main game loop updates ball position, handles bouncing off screen edges, draws trees and the ball, and controls the frame rate to 60 FPS.