Fang Decision Exercise - Move a ball around the outside path
Make your blue ball a moving target that can only move in a certain path. It should move in a square path around the outside edge of the panel. When it is intersected, move it to the other side of the canvas instead of to a random location.
Steps:
Need to keep track of Blue's x and y location, so add a blueX and blueY variable. Whenever you set the location of Blue, also set these variables.
Make a new method to moveBlue. If blueX >= .9, then the ball is on the right edge. If blueY <=.1, the ball is on the top edge. Move .1 each time. You will need to consider whether you are on a turning point and move differently for a turning point.
Add moveBlue to the advance method so blue moves every time the game advances.