Pongengine in node.js with REST-API build on restify
Pongengine is like, the name says, an engine that runs pong games on a node.js server. It provides an restfull API to get the games status, to log in to the game and to control the paddles.
Any Questions? Drop me a line: ste.hoyer(a)gmail.com.
Build a server or client-side js which controlls the paddle and is able to beat all the other challengers.
The rules are:
There are two ways to install the REST-Server. First you can install it via npm:
$ npm install pongengine
Second is to clone or fork this repository.
You can start the server by simply call:
$ node server.js
if you've installed it via npm you might use the correct path, like so:
$ node node_modules/pongengine/server.js
Now you can open you browser and had to a game named "foo" by opening http://localhost:8001/game/foo. Note that you can choose the game by altering the url.
Beside the spectator route, which you've already used, there are several other routes
Note: There are a maximum numbers of movements withing a time interval. If they are depleted, you get Status Code 500 and have to wait a while. You can get the number of movements available via game status field rightMoveCounter or leftMoveCounter and config field NUMBER_OF_PADDLE_MOVES.