pygame: TheGobbler.py

Next Chapter

Classwork: Modify CollisionDetection program so the bouncer gets bigger when it eats the green food, TheGobbler_YI.py.

Hint: use the attributes of the rectangle: width and length to increase the size of the gobbler.
bouncer[‘rect’].width and bouncer[‘rect’].height.

Collision Detection and Input

2nd version of the Collision Detection is the program RepellGobbler_YI.py, the green food bounces off the bouncer as it gets closer to it.

Note: The food doesn’t have to bounce off the edges of the window. They run off the window for the RepellGobbler_YI.py.
Hint for TheGobbler.py: use the attributes of the rectangle: width and length to increase the size of the gobbler.
bouncer[‘rect’].width and bouncer[‘rect’].height.

Resources:

1st ed Collision Detection

pygame Documentation