change the value of these attributes by the integer stored in movespeed movespeed stores how many pixels over blocks move on each iteration of the game loopand was set on line checking if the block has bounced check if the block has move out of the window if ['rect'top block has moved past the top if ['dir'=upleftb['dir'downleft if ['dir'=uprightb['dir'downright after lines to move the blockcheck if the block has gone past the edge of the window if it hasyou want to "bouncethe block in the code this means set new value for the block' 'dirkey the block will move in the new direction on the next iteration of the game loop this makes it look like the block has bounced off the side of the window on line ' if statementthe block has moved past the top edge of the window if the block' rect object' top attribute is less than in that casechange the direction based on what direction the block was moving (either upleft or uprightchanging the direction of the bouncing block look at the bouncing diagram earlier in this to move past the top edge of the windowthe block had to either be moving in the upleft or upright directions if the block was moving in the upleft directionthe new direction (according to the bounce diagramwill be downleft if the block was moving in the upright directionthe new direction will be downright if ['rect'bottom windowheightblock has moved past the bottom if ['dir'=downleftb['dir'upleft if ['dir'=downrightb['dir'upright lines to handles if the block has moved past the bottom edge of the window they check if the bottom attribute (not the top attributeis greater than the value in windowheight remember that the -coordinates start at at the top of the window and increase to windowheight at the bottom the rest of the code changes the direction based on what the bounce diagram in figure - says