SK8R – Final Project

Idea

My final project involved incorporating something that I love with p5js and Arduino. I took skating, one of my hobbies, and transformed it into a game. But not just any skating game, with this game, your controller is the skateboard itself!

Game

The game is straightforward. You have a player on a skateboard with the ability to move left and right. You have to dodge incoming fences by moving left and right. If you get hit more than 3 times, you lose the game and your score is recorded. The highest score is also shown at the end. You have the ability to play the game again or return to the home screen.

For the sprites in this game, I used resources from itch.io mostly.

The trees can be found here; the music can be found here ; the heart icons can be here; the fence image is from google; the tileset can be found here; the player sprites were made by me in Photoshop using original reference pictures that I took.

Arduino

My Arduino setup is mounted underneath my skateboard using velcro and consists of an accelerometer/gyroscope, a motor driver and 2 motors. I 3D printed wheel stoppers so that the skateboard does not move around when the player stands on it.

The accelerometer detects the tilt of the skateboard and moves the player accordingly. The motor driver vibrates when the player hits a fence or the sides of the road. The vibration is caused by some hot glue that I have applied to the gear of the motor.

The Arduino uses serial communication to talk to p5js in a chrome browser.

Code

All of the code is on Github. The final_project.ino file is for Arduino, and the rest is for p5js.

Video

Here are some videos of my final project in action.

 

Leave a Reply