top of page

Algorithm
The picture to the right shows an Algorithm in Mr. Hartzler's Country Music Maze. This particular algorithm controls when a user advances to the next level. When the green flag is clicked to start the game, the costume of the maze walker is set to "blank" (because the beginning starts on the intro page). The "score" and "background" variable are both set to 0. Then, in a "forever" and "if" loop, if Sprite 1 is touching the door sprite and "background" = 0 (the user is on the first maze), then the "background" variable is increased by 1, Sprite 1 is teleported to (175,115), and the backdroup is switched to "level2". The same situation takes place if the user is touching the "door" sprite but "background" = 1 (the user is on level 2), and the background is switched to "level 3". If the user is touching the "door" sprite and "background"=3 (the user has just completed the final maze), then "Sprite 1"'s costume is set to "blank" and the "end" broadcast is sent out, triggering the end page sequence.

bottom of page