Algorithm - Bouncing ball - pygame

Algorithm - Bouncing ball 
  1.     Start the program
  2.     Set screen size and background color.
  3.    Set speed of moving ball.
  4.    Create a graphical window using set_mode()
  5.    Set caption
  6.     Load the ball image and create a rectangle area covering the image
  7.    Use blit() method to copy the pixel color of the ball to the screen
  8.     Set background color of screen and use flip() method to make all images visible.
  9.     Move the ball in specified speed.
  10.    If ball hits the edges of the screen reverse the direction. 
  11.    Create an infinite loop and Repeat steps 9 and 10 until user quits the program
  12.     Stop the program


1 comment:

  1. 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

Don't be a silent reader...
Leave your comments...

Anu