For our final project, we have decided to proceed with a controller for the arcade game Mario Bros. It will use a potentiometer to control the player’s left and right movement, a switch to control the player’s jumping and crouching, a sound sensor to control the player’s running, and a button to begin the game. Our controller focuses on bringing parts of the game world into real life- the main aspect of it looking like a pipe, connecting to both the visual elements of the game and the characters’ work as plumbers. The remaining inputs follow this logic and are shown as different parts of the pipe. For example, the potentiometer is shown as a valve wheel on the pipe, allowing it to turn back and forth for movement. The switch is shown as a nut and bolt to the player, allowing the player to turn it up and down with a wrench, a piece not in the game, but again part of their work. Finally, the button is shown as a POW block on the top of the controller, allowing players to hit it to start the game. If shouting into the POW block, the character will run instead.
Pseudo-Code:
control Mario Bros gamecreate a switchPin variable and set it to A3create a buttonPin variable and set it to A1create a potPin variable and set it to A2create a potValue variable and set it to 0create a micCheck variable and set it to the microphoneset the potValue to what potPin readscreate a switchState variable and set it to falsecreate a buttonState variable and set it to falseif the buttonState variable is truethe game startsif the switchState variable is truethe character jumpselse if the switchState variable is falsethe character crouchesif the potValue is less that 341the character moves to the leftelse if the potValue is between 342 and 682the character doesn't moveelse if the potValue is above 682the character moves to the rightif micCheck is above 75the character runs


No comments:
Post a Comment
Note: Only a member of this blog may post a comment.