For our final project, we decided to create an interactive track for a vehicle that is controlled by colored cards. We attached a color sensor to the bottom of the car so when a card is placed before the vehicle, it will react according to the color of the card.
First, we started off by constructing our car so it could properly detect colors placed in front of it, and detect the angles that it needs to turn by placing a gyro sensor underneath as well. We then agreed on the rules and purpose of the game so that we could have a better sense of how to program the EV3. We figured that our project would be more interesting if the audience had to control the vehicle with various cards rather than remote control because this allows the user to interact with the environment as well rather than standing in one place. Also, part of the challenge of getting the car from point A to point B is figuring out how the car responds to the different cards. The user has to be quick on their feet to identify the car’s different actions before it goes off track or into an obstacle, resulting in a loss in the game.
Then we wrote the code to detect the colors of the cards that we are using and follow a specific command when these are detected, by using a case structure inside a while loop. This way the car can identify any of the colors at any given time and respond according to the commands such as turn right, turn left, move forward, and brake. Since our track is the black floor with obstacles , the robot is programmed to move forward at all times when it is on black and come to a stop when detecting white (meaning the user lost). The cards we use are meant to manipulate the way the car moves around the track, trying to dodge to obstacles in order to reach the finish line.
After our presentation of our prototype we were able to gather valuable feedback to consider when moving forward with our final project. Our final project consisted of two cars for multiplayer use, a new platform with multiple courses, and new controls.
We created a second car in order to open up the game to multiple players at the same time, we realized that single gameplay took a very long time and we figured it would be best to suit multiple players and add a competitive feel to our game. Our second car, however, was designed differently to offer the player a different option, either a truck or motorcycle model. This allowed us to manipulate the design of our courses so that they can be equally difficult for both players.
We changed our platform by adding different obstacles, building-like paper blocks laid across the platform. We designed three different courses to adjust the difficulty for different players, offering multiple levels to our game. They were designed so that the only route to the finish line required using most of the cards to test out the multiple functionalities of the vehicles.
Also, we incorporated different options for car controls to offer multiple methods of approaching the finish line. For example, before we only had two options, red turns the car to the left and blue turns the car to the right. This time we added white which paused the vehicle in it’s position to allow the user time to strategize for their route. Then, we added green which allows the vehicle to turn a full 180 degrees. This was very useful in cases where the players kept getting stuck in certain areas of the platform, or they were very close from crashing/going out of bounds. As for the original red and blue cards, we changed the angles the EV3 read from 90 degrees to 45 degrees. We realized this was a better bet because the players found themselves stuck at certain points where their only option was to keep turning back and forth with these two colors. Using a 45 degree angle allows them to have greater control over the paths that the vehicles take and a better chance of reaching the finish line.