techninja / ninjanode

A node.js implementation of the ninjaships.js library, made into a complete HTML5 multiplayer game!
14 stars 8 forks source link
game javascript multiplayer nodejs socket-io

ninjanode demo image

ninjanode: A node.js implementation of the ninjaships.js library I spent a couple days on and made into a complete HTML5 multiplayer game! Like the ninjaships library before it, I've carried on the tradition of doing nothing in canvas.. everything is an regular old HTML element, dripping with diabolical CSS! Yes, it's crazy... my kinda crazy.

Designed for Mozilla Firefox 12+ (mobile or otherwise), and works great in WebKit (Chromium/Chrome, Safari/iOS). Though I tried it once in IE9, and nearly died.

Just visit the site, and you're in! Enter a nick name, select your ship, and you'll be off and firing at all your friends in the vacuum of virtual HTML space.

Check out the official live demo @ http://ninjanode.tn42.com (uptime not guaranteed, actually, you're lucky to find it running at all)

Client side Requirements & Caveats

Well, you knew there had to be strings, didn't you...

Game Features

Server Installation

  1. Clone or download this repo to your prospective server.
  2. With node and npm already installed, run npm install within the repo root, and this should install socket.io, express and sanitizer dependencies.
  3. Run node ninjaserver.js 4242, where 4242 is the port you wish to host from. If left out, will default to 4242.
  4. Aaaand.. you're done! I recommend a daemon like forever to run the server and keep it up.

Time to play

This is a multi-player game, no AI just yet. Get some willing friends/co-workers/neighbors/internetizens and tell them to go to the server URL. Use the ↑ up & ↓ down arrow keys to thrust in a direction, set by the ← left and → right arrow keys. Space bar fires primary weapon, and 'm' fires secondary weapon, a space "mine".

Take care in selecting your ship! Some are fast and slow to turn, some accelerate quickly, with a low top speed, some fire quickly, but have lower maximum shield power. All stats are given next to each ship on the selections screen, so choose wisely, and mix it up. Want a new ship? press F5 to refresh the page and try with a different ship.

Credits

Thanks to my girl "Super-Awesome" Sylvia for helping with the ideas, and the second set of three ships originally created our Squishy Space Race DML 2012 demo, not to mention countless play-testing sessions!

Credit to Everaldo Coelho for the fanciest of the Ship graphics.