22 October 2023

Scaffolding: Progress Review - Sonic Spinball Pinball Machine Controller

       For my unconventional game controller, I have chosen to make a miniature, handheld pinball machine controller for the game Sonic Spinball. As the game is a pinball game, I figured it would be cool to be able to control it with a pinball table, making players feel as though they were playing the game on an actual pinball machine. Conceptually the controller will function like an actual pinball machine would; there will be a switch on either side that flipping will control the flippers in game, a plunger at the bottom that when pulled and released will launch a ball that covers the Circuit Playground Express' built-in light sensor and will cause Sonic to jump in-game as well as toggle both flippers, and finally two light sensors within the machine that can be covered with a ball by tilting the controller left or right to cause Sonic to move left or right in-game as though the player was tilting the pinball machine in order to cheat and move the pinball in a more desirable direction.



                                                              Controller design sketch


                                                        Schematic of controller circuit

// Code written by Kyle Amburgey, 2023

 

#include <Adafruit_CircuitPlayground.h>

#include <Adafruit_Circuit_Playground.h>

#include <Keyboard.h>

#include <KeyboardLayout.h>

// #include external lightsensor library

// #include mini toggle switch library

 

// initiate Circuit Playground light sensor, pin A8

 

// initiate all three external light sensors

const int lightSensorPin1 = A7;

const int lightSensorPin2 = A1;

const int lightSensorPin3 = A0;

// initiate both mini toggle switches

 

void setup() {

  //Opens CPE serial port

  Serial.begin(9600);

  // 1 second delay

  delay(1000);

  // Starts CPE

  CircuitPlayground.begin();

  // Allows keyboard controls

  Keyboard.begin();

  // Set Circuit Playground light sensor as input

 

  // Set all three external light sensors as inputs

 

  // Set both mini toggle switches as inputs

 

}

 

void loop() {

  // If light sensor 1 is covered, then press and hold "left arrow key"

 

  // If light sensor 2 is covered, then press and hold "right arrow key"

 

  */ If light sensor 3 is covered, then press and hold "C" (both flippers / jump), then delay for 1 second/*

 

  // If toggle switch 1 is switched on, then press and hold "Z" (left flipper control / jump)

 

  // If toggle switch 2 is switched on, then press and hold "X" (right flipper control / jump)

 

}

                                                        Pseudo code for controller


No comments:

Post a Comment

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