figure - an altered screenshot of the animation program how the animation program works in this programwe will have three different colored blocks moving around and bouncing off the walls to do thiswe need to first consider how we want the blocks to move moving and bouncing the blocks each block will move in one of four diagonal directions when the block hits the side of the windowit should bounce off the side and move in new diagonal direction the blocks will bounce as shown figure - the new direction that block moves after it bounces depends on two thingswhich direction it was moving before the bounce and which wall it bounced off of there are total of eight possible ways block can bouncetwo different ways for each of the four walls for exampleif block is moving down and rightand then bounces off of the bottom edge of the windowwe want the block' new direction to be up and right we can represent the blocks with rect object to represent the position and size of the blocka tuple of three integers to represent the color of the blockand an integer to represent which of the four diagonal directions the block is currently moving on each iteration in the game loopadjust the and position of the block in the rect object alsoin each iteration draw all the blocks on the screen at their current position as the program execution iterates over the game loopthe blocks will gradually move across the screen so that it looks like they are smoothly moving and bouncing around on their own post questions to