Objective:
To build a game and make an alternative controller to play said game
The Initial Idea: For this project, I worked with a partner named Ollie Kimlicko. When brainstorming ideas for what the game could be, there were a few things to consider:
The game needed to be complete in a few weeks
We wanted the game to be easily playable by any user
The game needed to be quick and low commitment
With everything in mind, we decided to create a simple game with a bunch of unconventional interactions. This was because if we were to present this project at something like an expo or arcade setting, we wanted users to quickly understand what was going on. This meant the game wouldn't have any complex mechanics or long-term storylines.
The game we came up with was called Janitor Supreme, a multitasking game where the player would use a controller made of actual janitor supplies to fix a ratty bathroom for as long as they could. The game mechanics were simple: random problems would occur in the bathroom, and players would need to do a single gesture to fix the problem. As time goes on, the problems get generated at a faster rate. If players cannot fix the problems fast enough, the game ends. Of course, multiple events can run at the same time.
Building the Controller
At its most fundamental level, the controller circuit consisted of a Teensy microcontroller, 4 buttons, a potentiometer, and a photocell. The Teensy made it so that the other components could be programmed in Arduino to activate keyboard inputs, which could then be accepted by P5js, the library we used to render our game.
The controller included interactions for the following in-game events:
Toilet flooding: Players use a toilet plunger to click a button and unclog the toilet
Pipe leaking: Players turn a faucet connected to a potentiometer to adjust the faucet in the game and stop the leaking
The room getting cold or stinky: Players open and close a vent, which effectively toggles a button to correspond with the vent in the game
Lights turning off: Players shine a light on the photocell to turn the lights back on
Flies: Players slap a button using a flyswatter to kill the flies
Rats: Players use a spray bottle to click a button and get rid of the rats
Here is a schematic of the controller circuit. It is important to note that the buttons do not have pull down resistors because we used INPUT_PULLUP in the Arduino code. Since we used buttons (digital sensors), we had to make sure to use 3.3 volts rather than 5 volts because each pin on the Teensy shouldn't get more than 3.3 volts. If it gets any more, the Teensy will overheat and burn out. When we tried to use 5 volts, our analog sensors did not create any issues, but our digital ones did.
Fabricating the Controller:
The base under the tiles is made of plywood and 1x4 lumber
Wiring for each of the six sensors underneath the base
The arcade button to slap with a flyswatter
The faucet attached to a potentiometer
The vent opens with a lever which presses against a button
The spray bottle button is pressed by a brad on the trigger
The plunger sits on a foam pressure pad on top of a button
The layout of the controller with janitor supplies
Coding the Game
There were two major coding components for our project. Ollie coded the random event generation and programming for the Teensy microcontroller and sensors (main game logic) through Arduino. I rendered the digital game (animation and graphics) using P5js. The rendering was essentially an interactive environment that accepted keyboard inputs provided by the Teensy to make different events occur.
The code for the circuitry and random event generation:
https://github.com/aski4331/alt-arc/blob/main/Janitor5.ino
The rendering for the game:
The home screen
Gameplay where the bathroom has no active events
Gameplay where the bathroom has multiple active events
Game over screen
Playtesting
Gameplay with the controller and monitor