08 March 2025

Team 18 Progress Review

 We designed our controller to be based off of a dirt bike handle bar in relation to our game Trials Fusion, a platform racer where you play as a dirt biker racing to the end and doing tricks. Not only does the controller fit the visual theming of our chosen game but so do the mechanics' similar features of an actual dirt bike handle. Pressing on the brake lever works as a real one would along with connecting to the games brake button, twisting the throttle for the gas, and twisting the handlebar to the left or right corresponds to leaning forward and back in game. For two controls that are additional to this would be speaking at a high volume to bailout in game, and to blow on the circuit playground to restart to the last checkpoint. The controller matches the theming of the game along with some similar functionality to a real dirt bike handle, as well as keeping the controls fairly simple to use for the player.

/* 
 
Final Project: Game Controller Prototype Psuedo Code
Dirt Bike Handle Controller
Final Team 18
*/

START GameController

    //include Adafruit
    // Initialize the controller and sensors
    Initialize accelerometer
    Initialize sound sensor
    Initialize circuit playground (for blowing detection)

    // Main loop for reading inputs and responding
    WHILE Game is running:

        // Check for hand brake input (pressed)
        IF handBrake is pressed:
            Press square button (game brake)
        END IF

        // Check for thumb throttle input (twisted)
        IF thumbThrottle is twisted:
            Press X button (game gas)
        END IF

        // Check for handlebar tilt (using accelerometer data)
        tiltLeft = Read accelerometer for left tilt
        tiltRight = Read accelerometer for right tilt

        IF tiltLeft is detected:
            Press directional button (lean forward in game)
        ELSE IF tiltRight is detected:
            Press directional button (lean backward in game)
        END IF

        // Check for sound level above threshold (for bailout)
        soundLevel = Read sound sensor

        IF soundLevel > threshold (indicating speaking or loud noise):
            Press triangle button (game bailout)
        END IF

        // Check for blowing detection (via circuit playground)
        IF Blowing is detected on circuit playground:
            Press circle button (game return to last checkpoint)
        END IF

    END WHILE

END GameController

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.