So we decided to create a controller for playing the game Cuphead and designed it to fit the theme of the game as well. The physical shell of the controller is designed to be a mug with cutouts for the inputs and to fit the theme of the game Cuphead well. The controls are very simple but might take some getting used to. First starting off with the movement of the character, the controller is using an accelerometer for both the X and Y axis for movement. The player tilts the controller left of right and the character will move left or right and if the player flick the controller up, then the character will jump. For shooting, we have a cutout on the mug handle for a switch then when set in the high position will trigger constant shooting and when in the low position will stop shooting. We will also have a metal straw attached to the top of a potentiometer and when its turned to the voltage of around 341-682 then the character will switch weapons once. The motion is meant to simulate stirring the drink with your straw.
Pseudocode
// Section for establishing variables. Basic button
mapping is based off the Xbox controller
// Start of code for Controller (CupHead Controller)
//if statement for the switch defining if it is
high or low
//if switch is high, trigger output
action of the X button (Shooting)
//if switch is low, disable output for X
button
//Reads Analog voltage on the Controller
//if voltage is in the range 341-682,
trigger output for the Left Bumper (Switch Weapon)
//if voltage is 0-340, trigger no output
//if voltage is 683-1023, trigger no
output
//Accelerometer input for the controller for
the Left, Right, and jump motions
//if the accelerometer is read as being
tilted Left, trigger output to move character Left
//if the accelerometer is read as being
tilted Right, trigger output to move character Right
//if accelerometer is read as being
tilted up, trigger output for the character to jump
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.