Week 21 - ngetachew/Portfolio GitHub Wiki

Our main goal at the start this week was to optimize the layout of the game. Our game is set up to have an easy, medium, and hard mode. We created a special set of maps for each of these modes that of the corresponding difficulty. Before, the map was generated randomly, and the game mode only varied the amount of obstacles, so there would be times when the game would generate a map that was impossible to win(the fish was blocked off by obstacles). We printed out a grid on paper and used a plastic sleeve to draw out the path that we want players to take, and designed obstacles around that. We implemented them into the reset() function as shown below:

Our solenoid stopped working halfway into the week. It kept getting caught in the top position after we sent it a PWM Off signal. After discussing with our mentor, we found that the shaft had become magnetized because of its exposure to the high amount of current in the solenoid. The only way to combat this, we were told, was by sending the solenoid high amounts of current with High and Low PWM signals, and gradually decrease it all the way down to 0. This scrambles the domains in the shaft and demagnetizes it. We edited indeffectortest.py and wrote our code in there. This process took a few days to figure out, but it brought us success.