Flambe versus the World!

The game.

The (HTML5) engines war
You probably didn’t miss the engines war of the previous month: Unity announced Unity5 with WebGL support (which I already pre-ordered hurrah!) and Unreal Engine 4 did the same with an incredible price. That was for the big guys.
From a more indie friendly point of view, PixiJS continue to kick ass with awesome new features (cacheAsBitmap, blend mode for canvas, SpriteBatch…). Phaser using PixiJS as its rendering engine, is becoming much more popular every day and obviously more stable. PixiJS has really the wind in its sails because OpenFL switched to it for its HTML5 rendering engine!

Witchcraft Works
wwI had to make a new HTML5 game, Witchcraft Works, available through (iOS, Android wasn’t required) devices browser. Since Unity5 isn’t available yet and even if they will support WebGL it can’t be used on a mobile game browser while WebGL isn’t available on mobile yet (iOS I’m looking at you!). So I needed an engine working with Canvas.
In my latest HTML5 project, I summarized my first experience with PixiJS and the issue with performances (certainly not the engine’s fault). Since StarlingJS sounds like abandonned to me, and I wanted to test something new, CreateJS just has WebGL support, I didn’t feel confident with that engine (and add JavaScript coding…). It was finally time to give a try to Flambe, and I fell in love! I heard about it some years ago when I was most active in the Haxe community with a Citrus Engine‘s port.

With the same code base, coded in Haxe, Flambe enables to export Flash/AIR (web, mobile applications), Canvas (old browser, device mobile browser) & WebGL (web) builds!

As you probably know, I hate coding in JavaScript. With my previous project I found TypeScript not bad at all, but I’d to make a TypeScript definition file for feeling comfortable with PixiJS. Using external libraries in the project, I didn’t have TypeScript support for them, that was a mess… Using Flambe I’m able to benefit from lots of Haxe’s libraries, and yeah coding in Haxe is lovely!

When I played with NME, 2 years ago we were fighting with the lack of IDE support. There is an excellent plugin for Sublime Text, but I can’t feel enough comfortable, I needed an IDE. But now even if you’re not on Windows (and its awesome Flash Develop), you have cross platform Haxe IDE support with FDT which isn’t bad at all and IntelliJ (I prefered FDT).
Flambe works with a command line interface, but you can also have easily a .hxml file for your IDE 😉

Getting started with Flambe might be a bit complicated. Be sure to read its installation guide, have a look on the examples and on its official Cookbook. Holy crap we’re seriously missing documentation here! Don’t panic have a look on Mark Knol‘s one and you can already be grateful! Also be sure that Flambe will match with your project requirements (add no video support).

Entity component system
The first thing you will notice with Flambe is its entity component system. Unlike many frameworks which cloned Flash display list, Flambe works with an entity component system even for rendering stuff! Basically that means if you create a Sprite object, you can’t addChild children directly. You have to create a new Entity, add it a display object, and addChild this entity to a parent entity! It’s really troubling at first, but once you get it it works like a charm.
It’s sad that you can’t extend an Entity, it will be very useful for creating lots of custom objects, instead of that we are creating many Components for a project. I understand the design choice, but I find it too restrictive for making frameworks on top of Flambe. Also it would be cool to have getEntityAt method & I didn’t find an easy way to identify Entity/Component like we do with their name in Flash.
Anyway it’s very pleasant to use its entity component model once you get it.

With Flambe you will have to use Flump for your animations. Seems it sounds like a correct way for manipulating animations (you will write some JSFL for speeding your workflow), it’s crazy that Flambe can’t load SpriteSheet in any format provided by TexturePacker! I may have missed something but that means even for making a SpriteSheet of images you will have to import them in Flash and export them with Flump. What the fuck?

Ok here we go. On my latest HTML5 games I fought a lot with bad performances on mobile… Here it just works… like a charm! I didn’t have to fight with anything. I have a strong 60 fps on my iPhone4S and iPad3. Nothing to add. So kudo Bruno!!

I don’t need at all a Flash target, so why bother with Flambe?
Me neither, but having a Flash support will help you a lot with debugging your code!

Still not convinced by Flambe? Have a look on its showcase and see games made by big firms (Disney, Nickelodeon)!

Finally I’m back in the Haxe world and that’s very pleasant! Using Flambe at Da Viking Code gives me without any doubt a strong weapon for future HTML5 project! Feeling even more like a Viking 😉

7 thoughts on “Flambe versus the World!

  1. while WebGL isn’t available on mobile yet (iOS I’m looking at you!)

    iOS will never support it as said Apple. WebGL was implemented only for iAds 🙂 so forget it

  2. It’s been over a year now.
    Do you know if they added sprite sheet support in Flambe?
    It should be fairly easy to create a TextureAtlas class similar to Starling.

  3. Flambe is great in many ways, but it’s still lacking in a few. Text/font support is one — you have to create a bitmap font from scratch for every single font size, color, and style you need, and this is supremely unmanageable for large projects. I’d love to see this fixed in future versions. Vector drawing could use more features as well — last I checked, you could only draw rectangles.

Leave a Reply

Your email address will not be published. Required fields are marked *