Tag Archive for haxeflixel

An experiment with HTML5 in HaxeFlixel

I’ve been looking for a crossplatform solution lately, a solution that can export to HTML5, Android and iOS. Being a Flash developer I’ve been building successful apps with the powerful Adobe AIR crossplatform system, but one of the platforms it doesn’t support is HTML5. Not the best platform, but one that is gaining a lot of traction, and is being heralded as the future of the web. As much as I prefer the power of Actionscript coupled with AIR sometimes you can’t fight the trend, and it makes it especially hard when Adobe themselves just don’t seem to care about their own product.

I’ve looked at Phaser as a pure HTML5 framework, and I’ve actually been impressed with the performance shown by the game samples I’ve made with it.

After getting the thumbs up from me, I moved away from Phaser, and this week I’ve been looking at Haxe, OpenFL, and the HaxeFlixel Framework.


Now, HaxeFlixel doesn’t fully support HTML5 export yet, with documentation citing only ‘experimental support’. So I took an experimental look. I chose to persist with HaxeFlixel instead of rolling back to OpenFL because HaxeFlixel is designed as a game framework, with built in physics controllers, advanced Math and Tweening abilities, it’s the perfect framework for game developers. I noticed a lot of similarities with the Phaser Framework I was playing with last week, which is no real surprise as both Flixel and Phaser were existing Flash frameworks before people starting jumping ship from the slowly sinking goliath.

And the results from my experiment? Positive.

It isn’t optimized, and slightly buggy, but HTML5 export is definitely possible with Haxeflixel. So possible in fact that I built a breakout clone today. This was built using the current “dev” branch of HaxeFlixel on GitHub, so the improved HTML5 support over the “master” branch is still being worked on.

Before you click the link, keep this in mind

– resizing the window will resize the game, which will break the “replay” button at the end

– It may be slow and chuggy on mobiles not being optimized, but mobile play does work. EDIT: Not on iOS devices it seems. “Experimental support”!

– Like my other games in the last week, this is a simple prototype with only basic game elements.

That being said, click the image below to be taken to the game.


Desktop, Android, iOS, and hopefully very soon HTML5, HaxeFlixel’s future as the number one crossplatform solution is looking bright.

Breakout assets provided by http://kenney.nl/