FAQ - aduros/flambe GitHub Wiki

Frequently Asked Questions:

How do I _____ using Flambe?

Check out the Cookbook, which lists some common tasks and best practices. The code samples in the demo repository might also be helpful.

How does the entity-component system work?

An entity is an object in a game. Entities don't do anything on their own, components are attached to them to add data and logic. Entities are also hierarchical -- they can have other entities as children. This hierarchy when combined with the Sprite component, delivers the familiar Flash-like scene graph, but with the flexibility of being able to add other types of components.

Some components override each other if they have a common parent class. Adding a FillSprite to an entity for example will replace its ImageSprite. That's because they both extend Sprite. Since Sprite extends Component, anything that subclasses Sprite will share the "Sprite" namespace. Under the hood, this is implemented by giving a unique ID to each class that directly extends Component.

Does Flambe use NME/OpenFL or target C++?

No. Stage3D performance under AIR is acceptable for most mobile games, and comes with features that aren't in NME yet (debugging, web views, video, camera, easy native extensions). Using AIR allows us to reuse 99% of the code from the Flash target, which means less bugs. When testing your game in Flash, you can be pretty confident that it will look the same in Android and iOS.

It's possible an NME/C++ backend might be added in the future, but that will entail a lot of time testing and fixing native quirks, so it isn't a priority right now.

How do I do conditional compilation?

Sometimes you need two builds to be slightly different. One way is to use the compiler preprocessor: #if android foo() #else bar() #end will compile to foo() in Android, and bar() elsewhere. Another way is to have multiple .yaml configs that point at different main classes.

Is development on Linux supported?

Yes, except for iOS. The AIR SDK for Mac OSX actually works fine on Linux for Android development. iOS development requires Mac or Windows.