Algorithm - Bouncing ball
- Start the program
- Set screen size and background color.
- Set speed of moving ball.
- Create a graphical window using set_mode()
- Set caption
- Load the ball image and create a rectangle area covering the image
- Use blit() method to copy the pixel color of the ball to the screen
- Set background color of screen and use flip() method to make all images visible.
- Move the ball in specified speed.
- If ball hits the edges of the screen reverse the direction.
- Create an infinite loop and Repeat steps 9 and 10 until user quits the program
- Stop the program
Thank you for making it easy.I wanna know the various functions and its applications in Pygame module that help me to write my own code
ReplyDelete