Instructions: Press the buttons below in order to make Fabio move. up -0001000 (jumps up) down - 0000100 (crouch) left - 0100000 (run left) right -0010000 (run right) up & right - 0011000 (glide to random position and returns back to initial position) down& right- 0100100 (crouch and run right) A Button - 0000010 (teleport to a random position) B button - 0000001 (back flip)
Limitations: When a user presses the down and left keys, the character would crouch and move to the right instead of moving to the left, even though the bit string indicated that the character should move to the left. Documentation: The purpose of this program is to demonstrate our knowledge of lists, loops and conditional statements and use them to make Fabio move. In order to do this, we used bitstring combinations that were assigned to various combinations of keys to make these movements possible. Explanation: Stage - This section of code contains the loops for which the bit strings are created. The forever loop inside this block of code adds a number ‘1’ for an activated key. If a key is not pressed, the code would add a ‘0’. For example, if the user clicks the left arrow key, the corresponding bit string created would be 0100000. Fabio - This section of code contains the definitions for the actions that are performed by Fabio. With the bit string created by the code in the “Stage”, the code inside of Fabio assigns an action to that bit string. For example, when the bit string 0100000 is created from the “Stage”, Fabio deciphers it as the action to move left, thus moving left.