This example is "forked" from the original version created by Lee Brimelow, and available for download on the Adobe Gaming site.
The goal of this fork is to make it easy for you to get the example running in Flash Builder using AIR 3.2 and Flash Player 11.2.
I also did a small amount of refactoring to aid readability of the code.
The example itself shows how to use the Nape physics engine and the Starling 2D game framework, which is built on Stage3D to leverage the GPU.
The AIR SDK is dependent on the Flex SDK for the compiler. If you want to compile an AIR app, then you require Flex. If you want to use a new version of the AIR SDK in Flash Builder then you need to manually merge the AIR SDK with the Flex SDK.
As a developer looking at this code for the first time I want to make it as easy as possible for you to read the code and to run the game!
Assuming you have Git installed, you can clone the repo as follows:
git clone [email protected]:p15martin/starling-nape.git
Install the AIR 3.2 SDK in Flash Builder
Import the project in to Flash Builder (File > Import > General > Existing Projects into Workspace)
This is an ActionScript Mobile Project, which uses the SWF metadata tag to specify the attributes of the application.
I am using Hi-Res Stats to provide performance stats such as the frames per second.
The application descriptor (StarlingNape-app) sets the render mode to direct:
<renderMode>direct</renderMode>
The render mode enables Stage3D and GPU acceleration, if it's not set then you get a runtime exception saying, "Context 3D not available". Starling overlays this with its own message saying, "This application is not correctly embedded (wrong wmode value)".
If you are running in the browser, then set wmode="direct" in the HTML wrapper.
Introducing the Starling 2D framework