Interactive game - Hit the number!

PROJECT OVERVIEW

‘Hit the number!’ is an arcade-inspired interactive game, with the goal of scoring a sum total of 30 points. Points can be scored by hitting a number on the board with a ball. The number gets added to the score. A player may only hit 6 chances to get the score of 30 points.

MY ROLE

· Implemented physical computing using Force Sensing Resistor (FSR) Sensor using Arduino.
· Wrote a JavaScript code to interactively display user activity.
· Used Serial communication by connecting Arduino and P5.js Web editor.

TEAM

Jinhee Jung, Jihye Kim, Harshi Rambhia, Amogh Gharpure

ADVISOR

Eric Forman, Viola He

Timeline

Oct 2022 (3 weeks)

Tool

Arduino, P5.js Web editor (JavaScript library), Illustrator, Figma, Rhinoceros 3D
Introduction

A game where the objective is to score 30 points by hitting numbered targets on a board with a ball in six chances

‘Hit the number!’ is an arcade-inspired interactive game, with the goal of scoring a sum total of 30 points. Points can be scored by hitting a number on the board with a ball. The number gets added to the score. A player may only hit 6 chances to get the score of 30 points.

· Input: Player aims a ball at the board
· Output: The sensors successfully read that a ball has hit a specific target, adding the score
Programming

Arduino

As the game mainly involved hitting the target with an object, we used FSR (Force Sensing Resistor). After selecting the sensor, our team built the circuit and did pilot testing according to the actual game. The FSR is mounted behind this cardboard piece and on hitting it, it generates output.
Sensor simulation
FSR test
Schematic

P5.js

Basically, structure of the game is to get a score every time the user touches the sensor. There are four elements: current score, target score, number of trials, and max trial to complete this game logic.

To win "Hit the Number" game, the user must score 30 points in 6 attempts and the current score must equal the target score. To lose, the current score must be higher than the target score, not equal to the target score, or exceed the maximum number of trials.

Connecting between Arduino & P5.JS

This is the most hardest part in this project. When Arduino sends a string to P5.JS, P5.JS reads Arduino's data value. Whenever the data value of Arduino changes, P5.JS saves the data in the variable. It uses it to show it as four elements: current score, target score, number of trials, and max trial.
Design fabrication

Form design

We were figuring out how to design the board and we started by talking about the "target" mechanism. We decided on the mechanism and then calculated the ball size and figured out the hole dimensions. We used card paper for the top and bottom layers because we wanted it to look nice and detailed.
Sensor simulation
Blueprint of the board and layers
Crafting top target layer
Crafting structure and bottom layer
Structure for support and mounting hardware

Graphic design

As for graphic design, we got inspiration from the 8 bit arcade game and illustrate this images into our project. With this eye-catching visual, we tried to help users to navigate the game easily and get engaged in the game.

Possible improvement

1. The testing of the circuit revealed that either the sensing area was too small or the sensor was not sensitive enough to detect changes. To resolve this issue, one option is to get a larger sensor, while another solution could be to switch to a more reliable capacitive sensor.
2. The target score can be made random in the code, that generates a different number every time a new user plays the game.
3. If we had more time, we will add a common reset button for the Arduino and P5.

What I learned

The importance of pilot testing in sensor selection
It is important to conduct pilot testing during the early stages of sensor selection to identify any errors or shortcomings before expanding its use in later stages. This helps to address any issues in the ideation phase.

Up next