bouncer['rect'top +movespeed if bouncer['dir'=upleftbouncer['rect'left -movespeed bouncer['rect'top -movespeed if bouncer['dir'=uprightbouncer['rect'left +movespeed bouncer['rect'top -movespeed check if the bouncer has move out of the window if bouncer['rect'top bouncer has moved past the top if bouncer['dir'=upleftbouncer['dir'downleft if bouncer['dir'=uprightbouncer['dir'downright if bouncer['rect'bottom windowheightbouncer has moved past the bottom if bouncer['dir'=downleftbouncer['dir'upleft if bouncer['dir'=downrightbouncer['dir'upright if bouncer['rect'left bouncer has moved past the left side if bouncer['dir'=downleftbouncer['dir'downright if bouncer['dir'=upleftbouncer['dir'upright if bouncer['rect'right windowwidthbouncer has moved past the right side if bouncer['dir'=downrightbouncer['dir'downleft if bouncer['dir'=uprightbouncer['dir'upleft draw the bouncer onto the surface pygame draw rect(windowsurfacewhitebouncer['rect']check if the bouncer has intersected with any food squares for food in foods[:]if dorectsoverlap(bouncer['rect']food)foods remove(fooddraw the food for in range(len(foods))pygame draw rect(windowsurfacegreenfoods[ ]draw the window onto the screen