tklae / jetpets

Pong remake with pets on jetpacks. Jetpacks! Used as a tech demo / booth game for ThoughtWorks conferences.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Jetpets

Modern pong remake, using your mobile phone as the controller.

Demoed at the ThoughtWorks booth at Agile Australia 2013.

Tech stack: HTML5 / Node.js / Socket.io / Pixi.js / Box2D / Grunt

screenshot

Or see it in action here: http://www.youtube.com/watch?v=GSAISCejU9s

Local setup

Install Node.js version 0.10.x (homebrew is recommended for OSX), then run

npm install -g grunt-cli
npm install

We use grunt for building

grunt		# builds all assets into ./build and watches for changes
grunt test  # runs the unit tests
grunt integrationTest # runs the integration tests (including verifying connectivity with AWS)

And finally

npm start

This starts the server, and restarts it

  • if something goes wrong
  • when any server-side code changes

There are two different modes to run the app:

  1. The default way stores the player data in a local JSON file. This is the recommended mode for running the application in a LAN for development purposes or when there's no decent internet access. This mode will be the default if you start the application via npm start or node server.js
  2. The other mode stores the player data on S3, so you will need to include an aws.json file with S3 credentials in the root of the project. (ThoughtWorkers - there is one you can use on the jetpets myTW page). This mode will be activated if you start the application via node server.js --NODE_ENV=heroku

Playing the game

With the server running, open:

Deploying to an external server (ex: Raspberry PI)

The game needs to be built locally first, and the server will just:

  • run the server code (/src)
  • serve static assets & files (/builtAssets)

Just run make deploy [HOST=<IP address>] to build & copy all the required files over SSH.

The server will need to run npm install --production to get all the runtime dependencies.

Deploying to Heroku

You'll need to have the Heroku Toolbelt installed and a Heroku account. (ThoughtWorkers - see the myTW jetpets page for Heroku credentials)

  • If you need to create a new Heroku app for jetpets, use 'grunt app:<new-app-name>'.
  • If there is already an app, add it as a git remote ('git remote add heroku git@heroku.com:<existing-app-name>').
  • Once the app is set up, be sure to generate the build assets first ('grunt build'), before deploying ('git push heroku master').

Attribution

Thanks to http://www.freesfx.co.uk for the free sound effects

About

Pong remake with pets on jetpacks. Jetpacks! Used as a tech demo / booth game for ThoughtWorks conferences.


Languages

Language:JavaScript 94.5%Language:CSS 5.5%