Tutorial #2: Using GMP in a Palm application
These are the steps to getting the GMP game engine working in a Palm WebOS application. Thanks to Nigel Kelly for writing this tutorial!
- Create a new palm app with the name myGmpGame.
- Open the file index.html in the base of the game directory.
- You will see something like the following:
- The palm mojo framework is already included in the head of the file. To include the GMP game engine, copy the gmp-engine.js file to the base application directory, then add the following lines into the <body> section of index.html:
- Now create a new file called game.js in the base app directory (on the same level as gmp-engine.js). We'll be putting the hello world game tutorial code in here. Include the game.js file in the <body> section, below the gmp-engine.js file, as follows:
- Now go through the hello world tutorial, and take care to do the following:
- game.js replaces hello-world.js
- mygmpgame.css replaces hello-world.css
- The Palm Pre keyboard has no arrow keys, so change the left and right arrow keys to 'Z' and 'X'
- Now run the app in the device or emulator, and hey presto, you have a new little game to play!