Overview
Asteroids is one of the projects I've done in my Graduate program - NYU ITP.The background knowledge of this game is mainly from two courses, which are Dynamic Web Development and Mobile Lab. In this project, I've learned how to build a server and utilize web socket to transmit data from mobile lab to web servers, and then pass the data to front-end. In the future, I want to use this pattern to make a multiplayer web game by using mobile phones as a game controllers. 

Link to the Github Repository
Process
This project can be broken down to three parts:
Part 1. The Asteroids Game
I used p5.js as the framework to develop the backbone of the Asteroid game. In fact, there are lots of code references of this classic, iconic, and nostalgic arcade game. The one I followed is Daniel Shiffman's coding challenge on YouTube to develop the structure of this game.

Part 2. Mobile Game Controller
On the game controller side, I referenced from one of the course material of Mobile Lab, which is an app design and development class in NYU ITP. The reference used CocoaPods as the dependency manager, which allows Swift to access the WebSocket easily. On the interface design side, I tried to use GameBoy interface as first, but it's was not that easy to play with since the screen on the phone is flat, whereas the buttons of GameBoy are tangible. So I mapped the behavior of the spaceship to design another UI. Here's the final game controller user interface: 

This is the first version, and the video below shows that this UI is not very friendly to play with.
Part 3. WebSocket
I used ws as the web socket to transmit from the phone to the web-based game. 
Back to Top