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.

HaxeFlixel

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.

breakout

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/

Meta Data

Title: An experiment with HTML5 in HaxeFlixel
Date Posted: 09/04/2014
Posted By:
Category: Game Development
Tags: , , ,

4 thoughts on “An experiment with HTML5 in HaxeFlixel

  1. Development of HaxeFlixel is ongoing and very active. HTML5 target support is fairly recent, and it hasn’t progressed as fast as the other targets because we don’t have many developers dedicated to testing it, and submitting fixes specific to that target.

    With that said, there is currently a strong push to bring the HTML5 target up to speed, since it seems that’s a good way to reach the consoles(as well as mobiles). We need help to find and fix the issues specific to that target though, so if you’re interested in joining the team check out the “For Developers” section of the README:

    https://github.com/HaxeFlixel/flixel#for-developers

    • Gravatar of tom who made comment number 4 tom says:

      And that there is the reason I chose to persist with HaxeFlixel. The active and supportive community is the lifeblood of any framework.

      I’ll see if I can help out with the HTML5 targeting. I’m usually on the end of “Using Frameworks”, not “Building Frameworks”.

      But now’s as good as any time to start!

  2. Gravatar of Evil Dan who made comment number 5 Evil Dan says:

    You should also check out Construct 2 – another game engine with loads of output formats (including HTML5) – and stupidly easy to use. I’ve kinda fallen in love with that one.

    • Gravatar of tom who made comment number 6 tom says:

      I’ve given Construct 2 a look, I find it a little limiting, but it’s definitely a great starting point. We’ve made a couple of quick games with it where I work.

Leave a Reply

Your email address will not be published.