Basic Game Structure With ImpactJS & CocoonJS

17 Apr


The HTML5 app wrapper CocoonJS for iOS and Android platforms supports the integration of the popular Impact.js game engine. This article focuses on the basic folder structure with Jasmine test suit integration.

Folder Structure

* index.html: The HTML5 game page. The program entry point for both ImpactJS & CocoonJS platform.
* lib: Javascript files and libraries of the game.
* media: Images, sound clips, music files and other media files to be placed here.
* tools: Tools for handling level editing.
* weltmeister.html: Level editing tool of ImpactJS.

The files listed above come with original ImpactJS 1.21 package. The weltmeister.html and the tools folder don’t need to be included in the release of the game.

* webviews: Contains the HTML5 pages which presented in the webview of the converted iOS/Android game app.

Pages in the webviews folder are called from the CocoonJS platform(Converted Javascript codes) by using CocoonJS extensions.

* SpecRunner.html: The page to run Jasmine test specs.
* test: Contains Jasmine test specs for the game app.

SpecRunner.html and test folder are Jasmine test codes and don’t need to be included in the release of the game.

Program Flow

Main program entry: The flow chart indicates a way to structure an app with multiple games in it with the support of iOS/Android webview.

Leave a comment

Posted by on April 17, 2013 in CocoonJS, HTML5, ImpactJS, Javascript


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: