26 April 2026

Final Team 1 - Mario Bros. controller

    For this project, our team decided to create a controller for the Game Boy Advance port of Mario Bros., the arcade game. A primary goal our team was connecting controller aesthetics to the aesthetic of the game, and attempting to bridge functionality and believability. To achieve this, we chose plumbing pipes for the base of our design, as plumbing as a job and levels in the sewers are a primary focus of the game. Continuing with the pipe design, we included a valve wheel and wrench as inputs. To connect to the whimsical aspect of the game, we used a POW block, an item from the game, as a button on top of the pipe. Using these aspects to lay everything out, we connected each item to an input to bring the player into the job of the plumber characters. To signify each aspect as a potential input, we displayed the valve wheel and wrench in red to contrast with the mainly green design. The pow block stands as an additional blue object, and the top is lightly lifted, hinting again to the user how it can be interacted with. To connect each input with functionality, the valve wheel can be turned to control the direction of the game character, like one might control water. The wrench on the side is a built-in lever, and moving it up and down can control the player’s jumping and crouching. In-game, hitting the pow block can damage all enemies on screen. In our controller designer, players can hit the POW block, and trigger their ability to run. As the later sequels, the Super Mario Bros. games are known for vocally emoting as the move, loudly speaking at the controller(which the CPE is inside) will additionally allow the player to pause the game.

    Our team’s open ended question is: What size of the controller do you think would best suite the immersion and target audience of the game?

Virgil West:

  • Controller modeling
  • Blog posting
  • Schematics
  • Painting

Finn Albritton:

  • Coding
  • Bug testing
  • Writing
  • Soldering
#include <Keyboard.h>
#include <KeyboardLayout.h>
#include <Adafruit_CircuitPlayground.h>
#include <Adafruit_Circuit_Playground.h>

// Code for Project:Game Controller, Super Mario Bros.
// Final Team 1, Finnegan Albritton and Virgil West

// Global Variables

// Establishes A4 as the first potentiometer
const int potPin = A4;
int potValue = 0;

// Establishes A2 as the second potentiometer
const int secondpotPin = A2;
int secondpotValue = 0;

// Establishes A1 as the button
const int buttonPin = A1;

// Variables to check for inputs that need to be held down
bool crouchToggle = false;
bool buttonState = false;
bool buttonPrevState = false;
bool runToggle = false;

void setup() {
  // Sets up the CPE and Keyboard Controls
  CircuitPlayground.begin();
  Keyboard.begin();

  // Establishes the button mode
  pinMode(buttonPin, INPUT_PULLDOWN);
}


void loop() {

  // Controls function while the CPE switch is on
  if(CircuitPlayground.slideSwitch() == true) {

    //Reads the potentiometers and button
    potValue = analogRead(potPin);
    secondpotValue = analogRead(secondpotPin);
    buttonState = digitalRead(buttonPin);

    // Local variable activates the microphone and checks for sound
    int micCheck = CircuitPlayground.mic.soundPressureLevel(10);


    // Checks the first potentiometer for left and right movement

    // If the potentiometer is turned to the left, the keyboard input makes the character move left
    if(potValue <= 400) {
      Keyboard.press(KEY_LEFT_ARROW);
      delay(100);
      Keyboard.release(KEY_LEFT_ARROW);
    }

    // If the potentiometer is in the middle, the character does not move
    else if (potValue >= 401 && potValue <= 599){
      Keyboard.release(KEY_RIGHT_ARROW);
      Keyboard.release(KEY_LEFT_ARROW);
    }
// If the potentiometer is turned to the right, the keyboard input makes the character move right
    if(potValue >= 600){
      Keyboard.press(KEY_RIGHT_ARROW);
      delay(100);
      Keyboard.release(KEY_RIGHT_ARROW);
    }

    //Checks for the sound level of the user
    // If the user is loud enough, the keyboard input pauses the game
    if(micCheck >= 50){
      Keyboard.press(KEY_RETURN);
      delay(100);
      Keyboard.release(KEY_RETURN);
    }


    // Checks the second potentiometer for crouching and jumping movement

    // If the potentiometer is turned up, the keyboard input makes the character jump
    if(secondpotValue < 300){
      Keyboard.press('z');
    }

    // If the potentiometer is in the middle, the character does not take either action
    if (secondpotValue >= 300 && secondpotValue <= 400){
      // Resets the bool to false if input is not being held down
      crouchToggle = false;
      Keyboard.release(KEY_DOWN_ARROW);
      Keyboard.release('z');
    }

    // If the potentiometer is turned down, the keyboard input makes the character crouch
    if(secondpotValue > 400 && crouchToggle == false){
      // Sets the bool to true to hold down input
      crouchToggle = true;
      Keyboard.press(KEY_DOWN_ARROW);
    }


     //Checks to see if the button is being pressed
    if(buttonState == true){

      //If it is and the bool has not been triggered, the input will be held
      if(runToggle == false){
        Keyboard.press('x');
        runToggle = true;
      }
    }

    //If the button is not being pressed, the bool will reset and input will be released
    if(buttonState == false && runToggle == true){
      Keyboard.release('x');
      runToggle = false;
    }

  }
 
}


No comments:

Post a Comment

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