Due: Tuesday, Nov. 4 - 11:59pm
Extended to Thursday, Nov 6 midnight.
You start with three Magic Wands enlarged about 6 times so they look like poles. (Note: Make sure you add three magic wands one at a time. DO NOT put one magic wand in and make a copy of it. Copied objects share items and may confuse you and your program.) Then put a beach ball centered on the pole as in the picture. In the program, the beach ball will move up and down the pole to either the top of the pole or the bottom of the pole.
For each pole start with the beach ball at the top of the pole, or "all the way up". The start is as shown below.
A three-word code is where each word is either the word "up" or "down". These words are to represent the position of the balls on the poles for the solution. You will randomly generate the three words (using random). This code is not shown in the game. For the moment, assume the code is "down up up".
Each ball is associated to be either up (on top of the pole) or down (at the bottom of the pole). If you click on a pole, its corresponding ball position should change. If the ball is up when you click on the pole, then the ball should move all the way down to the bottom of the pole. If the ball is down when you click on a pole, its ball is changed to be all the way up on the pole. For example, in the figure above, the game started with all the balls at the top of the poles (in the "up" position), then the result below is after three clicks: the second pole is clicked once (ball2 moves down), then the first pole is clicked once (ball1 moves down), and then the second pole is clicked again (ball2 moves back up) and the ball positions then match the code of "down up up".
The game works as follows. You generate a three word code not equal to "up up up" (otherwise you would win right away) and not display the code. Then you click on the poles until their position matches the random code. A counter keeps track of how many times you have to click. The game ends when the balls on the poles match the three word random code. When the game ends something spectacular should happen to let you know the game is over.
Hint: To figure out if the ball is up or down on its pole, one way to do this is to put an invisible object in the middle of the pole and ask the question if the ball is above the object or not. In the first figure I have put ladybugs in the middle of the pole. They are not invisible so you can see them, but should be made invisible when the game is played as shown in the second figure.
Hint2: You probably want to use three code words. You may want to check something like "If ball1 is in the up position and the code1 is up, then ball1 matches its corresponding word code."
This part will be turned in two ways.
(Optional) If you want you can put these two files into one folder. Zip the folder with the two files and turn in the .zip file on blackboard under assignments.