Search

Final Project Blog: Frogger Game Pad


Credits:

Game Pad Design

Pressure Pad Lecture

Arduino Joystick Library


Materials:

Tools:

  • wire cutter

  • wire stripper

  • multimeter

  • wire crimper

  • wire cable connector kit

  • small Phillips-Head screwdriver

  • utility knife

  • heavy-duty scissors

  • cutting mat

  • vinyl cutter

  • 3D printer

  • Arduino IDE 1.8.15

  • RetroArch

  • MAME 2010 Core

  • Frogger Arcade ROM

  • PC/Mac


Constructing the Game Pads:


Side-view of the layers in each game pad. The pad controlling the UP movement will be connected together so that both pads will require contact in order to register a positive value


Constructed pads that will be sandwiched together. The bottom pad (left) has 1" wide foam applied around the edges of the ABS sheet.


Wire wrapped around the aluminum flashing


Completed bottom half of a single pad. Wire is wrapped in electrical tape to prevent unwanted contact with the other half. The top piece is then screwed into the other piece with 4 machine screws on each corner of the pad


Now that the pads are all constructed, I had to create some imagery that would tell you which button goes in which direction. I created a graphic in adobe illustrator based off of the original directional decals on the arcade cabinet, which you can see below:



I used a vinyl cutter to cut the decal out of 12 x 12" sheets of adhesive vinyl. After the vinyl is cut, you remove the backing and apply it to the surface of the pads like you would a giant sticker.


Finished pads


Once the vinyl is applied, I then began the process of mounting the pads to the yoga mat to keep them in place while playing. This is done by using the screws and nuts on the corners of each pad. The yoga mat provides extra cushion when playing on a hard surface and prevents the pads from slipping and scratching the hardwood floor.


One thing to note: The vinyl makes the pad surface a bit more slick so it's recommended to play the game in shoes or with bare feet. Ultimately shoes seem to be the best option because it allows for maximum contact of the conductive material, which in turn provides better feedback for the game. Playing this game is tiring, so shoes also provide added support for your feet.


Constructing the Mini Coin Cabinet


CAD file designed in SolidWorks to hold the coin mechanism, player selection buttons along with the Arduino and cables required for the game pad


Coin switch next to the coin slot mechanism, designed after a slot in actual arcade cabinet


Installed coin switch on coin acceptor, secured with carpet tape


Testing the switch to ensure that it works when a coin goes down the slot



wiring up the buttons


Fully installed coin mechanism and buttons. The coin will slide out of a slot in the back of the box to be reused


Above is the fully installed Arduino and breadboard inside of the mini coin acceptor. Cable management was a bit of a nightmare for this build due to the tight space, but it all fit pretty well in the end.


Complete housing with holes made for the Micro USB and controller cables.


Above is a demo of the coin mechanism, you can hear the Frogger chime signaling that your coin has been accepted. I found that the coin mechanism sometimes doesn't register, there are definitely tweaks to my design that I can make to ensure the game accepts your quarter every time. In the case of my machine, sometimes it eats your quarters - which is honestly a pretty accurate simulation of an actual arcade cabinet.


The Code


After a lot of playing around, here is the final code for my controller. For this specific code, it turns out all I really needed to do to fix the excessive button press issue was to add a delay. I know delays are not ideal, but because my code is quite simple, it works quite well. I will definitely take the time to add a millis() function to the code in a way that keeps track of each button individually to have more control over the code to add more functionality in the future, but for now the code works well with the pads as they are now.


// The digital pins 6-12 are grounded when they are pressed.
//
// NOTE: This sketch file is for use with Arduino Leonardo and Arduino //Micro only.
//
// Joystick Library: 
// https://github.com/MHeironimus/ArduinoJoystickLibrary/tree/version-2.0
//--------------------------------------------------------------------

#include <Joystick.h>
//pin 6 = 1 player
//pin 7 = 2 player
//pin 8 = coin
// pin 9 = up
// pin 10 = down
// pin 11 = left
// pin 12 = right

void setup() {
  // Initialize Button Pins
  pinMode(6, INPUT_PULLUP);
  pinMode(7, INPUT_PULLUP);
  pinMode(8, INPUT_PULLUP);
  pinMode(9, INPUT_PULLUP);
  pinMode(10, INPUT_PULLUP);
  pinMode(11, INPUT_PULLUP);
  pinMode(12, INPUT_PULLUP);

  // Initialize Joystick Library
  Joystick.begin();
}

// Constant that maps the phyical pin to the joystick button.
const int pinToButtonMap = 6;

// Last state of the button
int lastButtonState[7] = {0,0,0,0,0,0,0};

void loop() {

  // Read pin values
  for (int index = 0; index < 7; index++)
  {
    int currentButtonState = !digitalRead(index + pinToButtonMap);
    if (currentButtonState != lastButtonState[index])
    {
      Joystick.setButton(index, currentButtonState);
      lastButtonState[index] = currentButtonState;
    }
  }

  delay(100);
}

Play Test 1



After a successful first test playing a game of Frogger on the current pad setup, I had my buddy Sarah try to play it and noticed that she was having a harder time getting the pads to register than I was but after a bit of play, she was able to get it consistently working. However, there is the issue of the button registering multiple times in rapid succession when seemingly idle on the pad, so I will have to figure out how to fix that issue. It was definitely a source of frustration for her when playing.


Play Test 2


A lot changed between the playtest above and where the controller is at now. I added the ability to go backwards and made sure that the pads won't slip around while you're stomping on them. Here's the same playtester giving it another shot:



Post-Mortem


Overall, I'm happy with what I was able to accomplish in a relatively short time. I build a physical gaming pad for my favorite arcade game of all time, and the fact that I keep wanting to play it is a testament that it's quite fun (at least for me).


The game is VERY hard to play this way, and that's something I only realized after I made the controller. The game by design requires quick decision making and punishes you for taking too long to decide where to go. By requiring you to jump or use your foot to change direction, the added time it takes to physically move the frog requires that you make directional decisions even faster. This turns the game of Frogger from a reactionary game to a game of speed chess, where you need to plan several moves ahead.


This adjustment in gameplay strategy was an unintended consequence of using this controller, and I'm still not sure what it adds to the experience of playing Frogger. I will say it made for a hilarious time when we were playtesting it and maybe that's enough - just a way to revitalize a fantastic game and get some exercise at the same time.


Other than the gameplay itself, I do need to adjust the design of the coin box because the coin switch occasionally doesn't register/the coin doesn't come out the back like it should, all easy adjustments to make. The cable management of the cords going to the pads could also use more work as well, and ideally I would like to wire the pads up so that only one cable comes out of the top center of the controller. That will require a bit more thought into the design of the pads themselves. I didn't factor the cabling aspect into the design because I wasn't sure of button placement when I started building them, but I definitely think the overall controller design could benefit from a redesign to spruce up the quality and longevity of the pad itself.


Lastly, Sarah sums up the experience of playing Frogger using a physical pad pretty well in this short clip below: