The game consists of following files:
www/index.htmlthe page viewing the game
www/app.jsgame code including logic and ui
www/textures.jsdefinition of game graphic textures
www/media/*graphic image files
In addition to the game files, Stage.js build for Cordova platforms is also needed:
Now all you need is to build your project. But first make sure you have installed NPM and then install Cordova 3 CLI:
npm install -g cordova
You don't need to create a new Cordova project, but if you like just copy above files after creating it.
First, add iOS platform to your Cordova project:
cordova platform add ios
Then, use Cordova
prepare command to prepare your iOS project using
merges folders and Cordova
cordova prepare ios
You iOS project is ready and available in
platforms/ios, you can run or build it using Cordova or your own development kit.
For other platforms you can follow similar steps.
Android is also similar but requires an additional step. First, add Android platform to your Cordova project:
cordova platform add android
HTML5 Canvas usually doesn't perform well on Android, but with FastContext Corova plugin you can wire it to a native GLSurface. Install FastContext:
cordova plugin add https://github.com/piqnt/fastcontext
Note that FastContext takes up entire screen and covers the HTML page.
Then, prepare your Android project:
cordova prepare android
Now your Android project is ready, again, you can run or build it using Cordova or your own development kit.
Graphic SVG files are included in
arts folder. You can export them manually or use svgexport.
First, install svgexport:
npm install svgexport -g
Once svgexport is installed, you can export arts:
svgexport art/game.json svgexport art/ios.json svgexport art/android.json