Skip to content

I've added a Pygame script for a bouncing ball animation. #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

nagdeepanjan
Copy link

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 Ball class to handle position, movement, and drawing of the ball.
  • Includes a draw_tree function 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.

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 `Ball` class to handle position, movement, and drawing of the ball.
- Includes a `draw_tree` function 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.
Copy link
Author

@nagdeepanjan nagdeepanjan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

nagdeepanjan and others added 4 commits May 24, 2025 21:42
Co-authored-by: amazon-q-developer[bot] <208079219+amazon-q-developer[bot]@users.noreply.github.com>
Co-authored-by: amazon-q-developer[bot] <208079219+amazon-q-developer[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant