16 March 2026

Scaffolding: Progress Review: Team 11

Concept/Mechanics

Our selected game is Sonic Robo Blast 2 Kart (SRB2 Kart)

Our controller is styled to mimic the radio of a car, we thought it would be a fun and cool idea since the music of racing games help set the emotions of high speed cars going around the race track. We also just thought it was goofy to control a car with a radio (since it's the last thing you want to be 'playing' with when actually driving). When you 'increase the volume' by turning up the left knob, the player will accelerate. Some form of PWM will be used to add a sort of analog feel to this normally digital input. When you 'scroll the radio channels' by turning the right knob, the car turns left and right. Placed above the volume knob is a slider that has 2 inputs, left position for holding the drift button, right position for using the item, the middle position for neutral (no input so the player can continue driving normally).


Sketch


Schematic


Pseudo Code

// Setup
// Assign the Left Knob to Pin A1 (Speed)
// Assign the Right Knob to Pin A2 (Steering)
// Assign the Slider to Pin A3 (Item, Neutral, Drift)
// Create variables to hold the values for all three sensors
// Create a 'Stopwatch' variable starting at 0 to track time
// Create a 'Is W Pressed' variable starting as false

// Void loop
// 1. Run the "Read Sensors" function
// 2. Run the "Handle Speed" function
// 3. Run the "Handle Steering" function
// 4. Run the "Handle Slider" function

// Read Sensors
// Read Left Knob (Speed): Map the 0-1023 range to a 1-10 range (10 is max speed, 1 is braking)
// Read Right Knob (Steering): Map the 0-1023 range to a -127-127 range (analog range for controller)
// Read Slider: Map the 0-1023 range to a 1-30 range

// Handle Speed
// Check the board's internal stopwatch and save it as 'Current Time'
//
// If Mapped Speed is 10:
//    - Hold 'W' down constantly (Full Throttle)
//
// Else If Mapped Speed is 1:
//    - Hold 'S' (Brake)
//
//  Else (Ehe speed is anywhere between 2 and 9):
//       - Calculate a "Press Time" (Higher speed = longer press)
//       - Calculate a "Release Time" (Higher speed = shorter release)
//
//       - If 'W' is currently pressed AND the "Press Time" has run out:
//           - Release 'W'
//           - Reset the stopwatch
//
//       - Else If 'W' is currently released AND the "Release Time" has run out:
//           - Press 'W'
//           - Reset the stopwatch

// Handle Steering
// - Send the mapped Right Knob value to the Gamepad Left Stick X-Axis

// Handle Slider
// 
//    If Slider is between 1 and 9: 
// - Hold 'Space' (Use Item)
//       - Release 'Left Shift'
//
//    Else If Slider is between 11 and 19:
// - Release Space and Left Shift (Neutral)
//
//    Else If Slider is between 21 and 30:
// - Hold 'Left Shift' (Drift)
//       - Release 'Space'




No comments:

Post a Comment

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