2023 Group 8 – Ball Maze Game

Group Members:

  • Emir Savas
  • Logan Shalloe
  • Matthew Su

Project Brief

Our chosen brief was to create an ‘escape room puzzle’, with ‘interactive game design.’ We chose to go with a ball maze puzzle game, where you use the joystick to tilt the maze, to try and get the ball from the start to the finish, avoiding the holes in the ground. After completing the puzzle, the maze reveals a code which you use to escape the room.


Project Planning


Design Process

Low-fidelity prototypes: 

In the idea stage, we made a spin puzzle and concluded it would be too simple to solve, and difficult to detect when it is solved using electronic components that we had access to.

This model shows the first maze idea, where a ball will move from point A to point B with the user’s input. There will be potholes to make the game more challenging. We have variation in difficulty by setting two routes by which the user can undergo, one is more difficult and the other is easier to go through, but both lead to the same finish.

We chose to go with a square maze, as the symmetry will help with the balance of the servos, the maze is a 12×12 grid with gaps of at least a half square.

The design of the maze includes multiple routes to the end, the easier and harder ways marked out, the easier ways have larger gaps to allow more space, with the harder ways made tighter with more frequent holes in the ground.

The first concept uses two servos, stuck to each other to allow for movements in both directions. This was going to be placed underneath the centre of the maze. The second concept, which we followed through with is one that uses four servos, two on each level controlling the x or y direction tilt.

Started the making of the final maze.

Extending joystick length for greater control, attaching it to wooden base, hiding wiring with black cloth.


Maker Manual

Materials:

  • 4mm thick plywood
  • 3mm thick plywood
  • 4mm diameter metal ball bearing
  • 8mm diameter wood dowel
  • spare 5V USB cable

Circuit components:

  • 5x Micro servo SG90-HV
  • 1x Joystick
  • 1x PNP transistor

Tools:

  • Hand saw
  • Sandpaper
  • Glue gun
  • Hand drill

Sizes of wooden pieces:

Pieces cut from 4mm plywood:

  • 180x180mm (x2)
  • 180x8mm (x2)
  • 180x41mm (x2)
  • 188x45mm (x2)

Breadboard Layout:

A – Connect each one to a bare wire, which are placed at the ending of the maze close enough that the ball bearing will connect them

B – Joystick component.

  • purple wire to GND
  • blue to +5V
  • green to VRx
  • yellow to VRy

C – Connect to 5V USB cable for additional power. Connect the red and black wires from within the cable to the like-coloured wires plugged into the breadboard.

The Code

#include <Servo.h>

//transistor jumpstart

#define JMPSTART 11

//joystick

#define JOY_X A1

#define JOY_Y A2

//x servos

#define X_SERVO1 1

#define X_SERVO2 2

//y servos

#define Y_SERVO1 3

#define Y_SERVO2 4

//winning

#define WIN_SENSOR 7

#define WIN_SERVO 9

Servo xServo1;

Servo xServo2;

Servo yServo1;

Servo yServo2;

Servo winServo;

void setup() {

  pinMode(WIN_SENSOR, INPUT_PULLUP);

  pinMode(JMPSTART, OUTPUT);

  xServo1.attach(X_SERVO1);

  xServo2.attach(X_SERVO2);

  yServo1.attach(Y_SERVO1);

  yServo2.attach(Y_SERVO2);

  winServo.attach(WIN_SERVO);

  delay(20);

  digitalWrite(JMPSTART, HIGH);

  delay(20);

  digitalWrite(JMPSTART, LOW);

}

void loop() {

  if (digitalRead(WIN_SENSOR) == LOW) {

    winServo.write(130);

  } else {

    winServo.write(0);

  }

  int joyX = analogRead(JOY_X);

  int joyY = analogRead(JOY_Y);

  int xVal = map(joyX, 0, 1023, 0, 50);

  int yVal = map(joyY, 0, 1023, 0, 50);

  xServo1.write(xVal);

  xServo2.write(180 – xVal);

  yServo1.write(yVal);

  yServo2.write(180 – yVal);

}