Building a game with Node.js
With only a day to build it I felt I would be better off attempting to replicate an existing game. The focus of my feed was to play around with node not to try and create a brand new game from scratch. During my research I stumbled across a game built with node called Rawkets. With blog posts and talks about the development of the game readily available, it helped give me a kick start in building mine.
Leaderboard: Space Shooter Game
The concept of Leaderboard is quite simple. Each player has a spaceship they control and fly within a restricted space. The aim is to shoot and destroy other players to score points. The points you score grow exponentially, so the more kills you get without dying the more points you earn. At the end of the game the player with the highest score wins.
Building the game
Leaderboard is an online browser based multiplayer space shooter game. By building a browser based game I was working with familiar technologies such as javascript and html, but also some unfamiliar ones too:
- Node.js – server side javascript
- Socket.io – web sockets for realtime communication between browser and server
- MongoDB – for data storage
- HTML5 Canvas – for game display and graphics
Overall the development went quite smoothly, except for times where I had to remind myself of things I learnt in maths class back in school. But by the end of the day I had a fully working, though incomplete, game.
There’s more to come
With only a day I wasn’t able to complete the game in its entirety, so there’s plenty more I’d like to work on:
- Use MongoDB to save player scores
- Authenticate users with Twitter
- Work on Player movement and acceleration
- Add game audio
- Add touch controls
- Improve socket messages
- Add health rather than 1 hit kills
- Create a better name
- General code refactor and tidy
I really enjoyed working on this project, it was a nice escape and interesting working with something new. I plan to keep working on the game whenever I can so keep an eye out for the next update.