Skip to content

kpuwal/AsteroidsGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Asteroids Game Controlled with DIY Sensor Glove

screenshot

This small DIY project combines fun of game programming and super exciting capabilities of Arduino boards.

Asteroids game is loosely based on classic arcade space shooter. It is coded in JavaScript using p5.js client-side library for pleasant visual and interactive experience.

The Glove

The Glove designed as game controller is equipped with five bend sensors placed in fabric veins on top of each finger. Microcontroller mounted on the cuff captures movement in 3D space and sends this information via serial communication to a computer. The data is read by a simple Node.js based WebSocket server API and set as an input to a browser. The glove also includes super vibrant RGB LED ring for visual feedback.

screenshot

Playing the Game

The objective of Asteroids game is to destroy asteroids. The player controls a triangular ship that can rotate left and right, fire shoots straight forward. To move the ship, player applies thrust in a desired direction. To collect points, asteroids need to be destroyed. To collect extra spaceships (lives) player freezes and shoots frozen asteroids.

Controls:

Game as well can be controlled with keyboard.

  • Middle finger/:arrow_up: - direction and thrust
  • Thumb/space - shooting
  • Index finger/:arrow_down: - freeze asteroids

Hardware

  • Adafruit Pro Trinket Microcontroller with 5V operating logic and ATmega328 chip with 16MHz clock rate.
  • 5 long Flex sensors
  • Adafruit FLORA 9-DOF Accelerometer/Gyroscope/Magnetometer LSM9DS0
  • Adafruit NeoPixel Ring 16 x 5050 RGB LED with Integrated Drivers - for fun :)
  • FTDI to USB cable

Setup

After cloning the project, enter the following lines on the command-line:

$ npm install
$ npm start

Heroku

Online version

Third party libraries

References

CodingTrain


Things I have learnt from this project
  • sewing 😃
  • coding microcontrollers
  • how painful sensor calibration can be
  • making USB port talk to a browser
  • coding fully controllable game
  • generating randomly shaped asteroids on canvas

About

Arduino + flex sensors + 9DOF sensor controlled Asteroids game

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages