Skip to content
jeremyckahn edited this page Nov 1, 2012 · 3 revisions

If you'd like to work on the Pine App or test games you are building for Pine, follow this guide. Assumes a Mac or Linux environment with Node installed.

  1. $: git clone https://github.com/jeremyckahn/pine.git
  2. $: cd pine/ui
  3. $: npm install

Now you'll want to fire up the dev server. It's just a little Node server. In the ui directory:

  1. $: node dev-server.js
  2. In Chrome, navigate to localhost:5000.  You are now looking at the Pine app.

Adding a gamepad mapping

Gamepad layouts are normalized as much as possible for Pine games. We are aiming for a Playstation/SNES type of layout. Every type of gamepad must be configured individually. Theoretically, a mapping for your gamepad should work for every other user with that same type of gamepad.

  1. Click on "Gamepad Demo" in the Pine menu.
  2. This app can be flakey (it seems to be an issue with Chrome).  You might have to refresh a few times, mash on the gamepad, and maybe wait a minute before the browser recognizes the controller and anything shows up.  Eventually you should see a live readout of the controller state.
  3. The first line is the controller ID.  You will need this.  All of the other lines are the indices that refer to each button.  Here's an example of what you should see.  Each button has a unique index. Press each button on your gamepad to see what index they correspond to.
  4. Add a mapping entry to gamepadMap in pine.gamepad.js for your controller. The key for your mapping is the ID you saw in step 3.
  5. To test your mapping, navigate to http://localhost:5000/sample_game/ and press gamepad buttons.

If you make a new mapping for your gamepad, please submit a Pull Request and share it with the world!

Clone this wiki locally