Question: changePositions() method to calculate all shapes' new position. The method showShapes ( ) will be called then with the parameter true to show the shapes

 changePositions() method to calculate all shapes' new position. The method showShapes

changePositions() method to calculate all shapes' new position. The method showShapes ( ) will be called then with the parameter true to show the shapes with their configured color. The loop will finish by adding a delay of 1/10 of a second. NO YES Change loop variable Last loop var i? Init loop variable I for showShapes ( ) showShapes ( ) Delay 1/10 of a // white changePosition( ) every move // colors second Figure 5: Diagram of method showShapesMoving() changePositions( ) This method, as shown in Figure 6: Diagram of method changePositions(), will loop through all the shapes changing their position. Specifically, it will change the xPosition and yPosition of the top left corner of the shape, depending on their corresponding speed and Direction. The individual speed that every shape moves is the number of pixels. Change loop variable NO YES Init loop variable I for Calculate/update Calculate/update Last loop every shape new x pos i-th shape new y pos i-th shape var

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!