Safe Cracker Part 3 The Code: (Final Project) Michael Frankfort & Jill Sauer

After all of the electronics and hardware were essentially complete, it was finally time to start on the logic of the safe cracking through C code in processing. In general, the simulation plays as follows: Players are in a warehouse and arrive at a safe they need to crack. Luckily for them, they brought specific step by step directions to follow on a scrap piece of paper. The player must execute each move correctly in a row in order to move onto the next part of the safe. In the three given “levels” of cracking the safe, the players will interface with various buttons, all while rotating their device to the correct orientation. If a player gets a sequence wrong, they will lose all progress on that level and must restart form the beginning. The main problem with failure on the levels is that there is a global timer that ticks down quite quickly. Since you are robbing the facility at night, it is important that you make your escape before daylight. If the player cannot traverse the directions on all three levels within the time limit, they will be “caught” and have to start the game all over again. The code to implement all of this functionality was actually complicated and verbose. I ended up having to store all of the correct moves within special arrays, track the users current moves in lists, all well polling the hardware to see its’ current pin orientation. Complications arose when users rotated the device; the tilt sensor would receive many values very quickly, which would confuse the game logic into thinking that a player acted incorrectly when in reality they performed the correct maneuvers. Many added delays, timers and Boolean variables had to be implemented so that the hardware worked as smoothly as the software. Below is a placeholder screenshot of in-game footage that describes the above.

Leave a Reply