Skip to content

Adobe Flash: provides an example of using the Nape physics engine and the Starling 2D game framework.

Notifications You must be signed in to change notification settings

p15martin/starling-nape

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

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

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.

Why?

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!

Getting started

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)

Things to note

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.

Resources

Code walkthrough

How Stage3D works

Introducing the Starling 2D framework

Adobe Developer Connection, Stage 3D

Stage3D Examples

Epic Citadel

About

Adobe Flash: provides an example of using the Nape physics engine and the Starling 2D game framework.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published