Treehouse Toppers!
Hope you're faster and fitter than your friends!

Calibrate The Photoresistor
When you first upload onto the RedBoard the file containing the main Arduino code, open the Serial Monitor. The Serial Monitor should display on the top line "Set int brightness high to this number ---> ???" . Scroll down in the code to where int brightnessHigh is and plug in that number. Should be under "if(buttonState3==Low)" which is right under "Void Loop". This calibrates your photoresistor to your room's ambient lighting. You are now ready to play!
Gameplay
Make sure you have all your Arduino code files and C++ gameplay code file ready and loaded into Arduino and a C++ IDE respectively, the electronics assembled, your computer connected to the RedBoard using the USB cable, the game pieces at the starting point, and the photoresistor calibrated before you start playing. Also make sure the main Arduino code and the music challenge code are 2 separate files. You need to have them separate in order for the code to work and must switch between them for the challenges. Which file you should upload for each challenge is detailed under the "Challenges" section below.
Before playing, you might want to get into athletic clothing, as there are some fitness challenges in this game that might make you sweat!
Shuffle the fitness challenge cards and place them on the game board where it says "FITNESS".
Hit run on the C++ program and input the names of the three players. Follow the C++ program as it leads everyone through the game, including rolling the die for each player, telling them what space they landed on, and what space they will be on after attempting the corresponding challenge. Move your game piece to where the program tells you to.
When you land on a space, you will do the challenge that corresponds to that color. If you are unsure of what challenge you will be doing, don't worry, C++ will tell you! You will then input whether or not you won that challenge into the C++ program. A list of the challenges and how to play them are detailed in the "Challenges" section down below.
If you win the challenge, you get to stay where you are! If you fail the challenge... womp womp... its back to where you had just came from at the start of your turn.
If a player lands on a space labelled "JINX," they do not have to complete the challenge corresponding to the color of the space they landed on and instead can duel another player in any challenge! This can be any of the challenges in the game to something the challenger thinks of! From a fitness challenge to naming state capitals, there are a lot of options, but make sure the challenge that is chosen is safe and appropriate. Use this challenge to your advantage, because it is a game changer! The winner of the JINX challenge moves forward 4 spaces and the loser moves backward 3 spaces!
There are also "SKIP A TURN" spaces and a slide and crosswalk along the way that will affect your position on the board. If you land on a space with a slide or crosswalk and complete the corresponding challenge, you get to move across them! If you land on a skip... Sorry! Pass your turn this time. The way it works in this game is you move back to where you were at the beginning of the turn, which means you can roll when it is your turn again instead of your turn literally being skipped. Hopefully you don't land on the skip again...it would be bad to have a "SKIP A TURN" cycle occurring.
If you are wondering whether or not you are winning, if you are ahead of everyone else and closer to FINISH, then you are! If you are behind everyone else, then you are losing. But don't worry. There is plenty of gameplay for you to catch up and take the lead!
If you are not sure what you should be doing or where your piece should be, don't worry, C++ has got it covered! Simply look at what is outputted to the screen and proceed from there. Remember, this program controls the entire gameplay, so follow the instructions at all times!
The first player to land on space 60 EXACTLY and completes the corresponding challenge successfully wins the game and the game ends. The C++ program will also tell the players who won by congratulating the winner and ending the program. Any roll that leads to landing on a space greater than 60 will be invalidated by the C++ program, and it will move onto the next player. If you win, you are the Tree House Topper!
Some Rules to follow...
Everyone must follow the fitness challenges exactly, or all must agree on an acceptable alternative.
No take-backs in C++! If you type in the wrong answer, it's already too late, even if you got it right out loud to your friends. Move your piece back to where the program tells you to.
Play honestly! Don't cheat your friends.
If a wrong number is inputted for the Music Challenge by the other players, the participating player automatically can tell the program they won the challenge and can stay where they landed.
Move where the program tells you to move! It knows how to count and control the gameplay, don't worry.
For the JINX challenge, the player not participating should mediate and determine the winner.
If you lose a challenge and land on a slide or crosswalk, do not advance over them!
No rerolls! If you reroll you're stealing your friend's turn and throwing the turn order all out of order!
At the beginning of the game, the game pieces should NOT be on space 1. They should be placed right before "Start," or in other words, on space 0. This is how the C++ gameplay code is programmed as well.
Have fun! This is a competitive game, but you cannot enjoy it without fun!
Good luck, and may the best player win!

Challenges
Music Challenge
Are you a music wiz? Well this challenge will test even the most avid fans and listeners! When a Music challenge occurs, load the file for the music challenge code in Arduino. Hit the Upload button. The computer should be faced away from the player attempting the challenge, meaning only the non-participating players should be able to see the computer. Open the Serial Monitor and press the blue button to play a song. Have the participating player guess the song. The non-participating players should then take the number that pops up in the Serial Monitor and plug it into the C++ program to tell them the name of the song that is playing. The players can then verify whether the guess is correct or not by seeing if it matches with what is outputted to the screen by the program. This process will only work as long as the correct number is inputted into the C++ program, so it is important this is done properly each time! Follow the instructions given by the program to tell it whether you guessed the song correctly or not.
​
Hover Game
Have you ever wanted to have power over light and dark? Well, this game kind of fills that desire! To attempt the Hover game, the file containing the main Arduino code should be loaded in Arduino, the Serial Monitor should be open, and the photoresistor calibrated. Hit the Upload button. There is no button needed to activate this game, meaning you can jump straight into the game. Follow the instructions given by the Serial Monitor. Place your hand over the photoresistor to change the brightness level and press the red button when you have locked in your position each time. The Arduino program will display the reading to the screen. If it falls in the interval indicated on the screen, it will display a message saying you can move on to the next level. Else, it will just display the reading itself. There are 4 levels and you have two tries per level to get the correct position. The way you know if your two tries are up is if you do not get a message saying you can move on to the next level after you have attempted the current level twice. Essentially, the player needs to realize that they failed the challenge if this happens. But, if you complete all 4 levels, plug into the C++ program that you won by following the instructions given by the program.
​
Catch to the program: the program will display a message to move onto the next level if you hit the interval for that specific range, even if you are not on that level. For instance, if you are on level 1 and need to get it in between 80 and 100 but get it in between 70 and 80, you did not pass level 1 but did pass level 2. Please ignore this and play so that your target goal is the level you are on. Additionally, the game does not reset after each player, so the next player to play must treat it the start of the game to be level 1 and proceed from there. In other words, if player 1 gets up to level 3, the game does not reset to level 1 for player 2, so treat it like it is level 1! We apologize for this inconvenience.
Memory Challenge
If you've ever had someone brag about photographic memory, maybe this game will prove them wrong finally! To attempt the Memory challenge, the file containing the main Arduino code should be loaded in Arduino and the Serial Monitor should be open. Hit the Upload button. The players who are not guessing should be looking at the Serial Monitor, meaning the computer should be facing them and away from the participating player. The person guessing presses the yellow button and tries to memorize the sequence of the color of the lights lit up. The guesser relays this information back and the Serial Monitor is checked by the other players to verify if the guess is right or not, as it outputs the correct sequence to the screen. Input whether or not you won the challenge into the C++ program by following the instructions given by the program.
​
Fitness Challenge
To attempt the Fitness challenge, you must draw a card from the fitness challenge card deck. Input into the C++ program whether or not you completed the task written on the card you drew by following the instructions given by the program.
Instructions in Video Form!
In case you were looking for something a little more visible to help you play! Note that the photoresistor was already calibrated prior to recording this video, so a visual representation of the calibration is not shown. Be sure to follow the instructions for calibration prior to playing the game, or else the Hover game may not work!