Question: Create a Pygame Display that is 4 0 0 x 4 0 0 . Create a Rect that is 5 0 x 4 0 0

Create a Pygame Display that is 400x400. Create a Rect that is 50x400 and place it along the center of the Display, blitting to the Display a red Surface at the Rects coordinates.
Create a Rect that is 50x50 and place its left border at the center of the left border of the Display. Blit to the Display a blue Surface at the Rects coordinates.
Move the blue Rect from the left to the right of the Display at a speed of 5, and then back again from the right to the left. Repeat this cycle until the user closes the program. Add two more Rects with associated blue Surfaces, one which bounces along the bottom border of the Display at a speed of 20, and one which bounces along the top border at a speed of 10.
Using collidelist() or collideall(), change the red Surfaces color to green whenever ANY of the other three blue Surfaces Rects collide with the red Surfaces Rect. Change the Surface color back to red if no collision is occurring.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!