Skip to content

Cube bouncing against window edges and against a changing obstacle

License

Notifications You must be signed in to change notification settings

Kartmaan/bouncing_cube

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bouncing_cube 1.6.1

What does the program do ?

  • A cube bounces against the edges of the window and against a central obstacle which contracts little by little
  • The cube changes color depending on the location of its collision (upper/lower edges of the window, side edges of the window, over/under the central obstacle, etc.)
  • Each time the cube comes in contact with an edge of the window, the width of the central obstacle contracts a notch. The obstacle continues to contract to a minimum before it returns to its original size
  • The initial color of the obstacle changes color as it contracts
  • The animation speed can be controlled by pressing up arrow (speed ++) or pressing down arrow (speed --), the initial speed can be retrieved by pressing space
  • Real-time information can be displayed at the top left of the window (cube coordinates, obstacle width, vector etc. (Set infoDisplay to True)

Screenshots

Animation mosaic

bouncing

Infos display

bouncing_info

Requirements :

  • pygame