FINITE STATE MACHINES

OUR MISSION

During the past weeks, our group was tasked with the feat of solving the platform issue. The player was able to go through jump platforms, we wanted to prevent that and have the player climb up the jump platform when it touches the sides.

WHAT WE LEARNED

We learned that finite state machines reads what is going on in the code and reacts to it (if x happens, then y). For example, when we were working on the jump platform, we had to communicate in the code that if the player touches the left or right side of the platform, it could only go a certain directions and it has to climb up. The computer then reads the code, and if the requirements are met (if the player touches the left or right side) it carries out the ‘then’ functions. To carry out these functions, the computer has to recognize when the player has touched the jump platform. If it has, then the computer knows to enter the jump platform state to carry out the functions.

We also learned that the order of the ‘if then’ or ‘if else’ statements impacted the code. The computer generally tries to detect the first if statement first, so switching the order of the statements had an effect.

eofhreihfoerihgerohgergheorighrei