Scirra cog

About Us

We're a London based startup that develops Construct 2, software that lets you make your own computer games!


Browse all our blog posts

Latest Blog Entries

We love brains!

Join us! Joiiinnn ussss! Mooooree brains!

How Construct 2 helps make HTML5 work

by Ashley | 22nd, February 2012

It's interesting to read the continuing debate around HTML5. Our forum users also like discussing articles they find on the subject, especially in comparison to other technologies like Flash or native apps. Often these articles are written from a programmer's point of view. As a result they highlight technical details and problems which HTML5 programmers must overcome, and this can make HTML5 compare unfavourably to other technologies. However, from a Construct 2 user's point of view, many of the arguments simply do not apply because we've already done the work in our HTML5 game engine. For example, having to deal with browser quirks is often cited as a significant disadvantage of HTML5. We've actually been very impressed with how standards-compliant modern browsers are, but there are indeed some quirks that need workarounds (such as the recent issue with laggy keyboard input in Chrome that was particularly gnarly). So for Construct 2 users, this is not an issue at all: by using our engine, you get all our browser-specific fixes included. I thought more on the subject, and I came up with a whole list of similar recently-cited shortcomings of HTML5 which Construct 2 fixes for you. Here it is:

"Javascript is ugly!"

Obviously you don't do any coding in Construct 2, so any perceived ugliness is our problem only! Even if you're a plugin developer using our Javascript SDK, you only need to come up with small snippets of Javascript to flesh out the SDK template, which is really no problem at all despite the quirks of the language.

"Javascript is slow!"

Writing high-performance Javascript is sometimes contrived, especially when trying to eliminate garbage-collection pauses. We've done all the necessary work in the engine to adapt it to what Javascript is fastest at, while making it have a minimal garbage overhead. On top of that, we also support WebGL for rendering which brings native-like rendering speeds on supported systems. As a result, we've seen Construct 2 easily beat other Flash-based tools in benchmarks. Mobile performance is an area we're still actively working to improve, but the desktop results prove that Javascript + WebGL have the capacity to be faster than Flash traditionally has been.

"You can't run HTML5 games from the desktop!"

Actually, you can do this with Google Chrome. Mozilla are working on similar features for Firefox, and don't forget Windows 8 integrates HTML5 right in to the desktop.

"There are no good IDEs for HTML5!"

Well, this is the exact problem we hope to be solving with Construct 2 :)

"It all has to be open source (there's no way to hide code)"

By default Construct 2 games are passed through Google Closure Compiler to minify and obfuscate the code, making it impossible to read and extremely difficult to reverse-engineer. We've specially written the runtime to pass through Closure Compiler's Advanced mode, providing the highest level of compression and obfuscation. Even "beautification" does not undo the name mangling that Closure Compiler does. This solves the "view source" problem.

"There's nowhere to publish the games!"

You can currently publish Construct 2 games to Facebook, Kongregate, the Chrome Web Store, as iOS web apps, on your own server, to our Arcade, on Dropbox for quick tests, and we're working on integrating PhoneGap and AppMobi's wrappers to publish your game as native iOS and Android apps. We expect many more traditionally Flash based publishers (especially arcades) to shift over to HTML5 over time, like Kongregate have started.

"Games cannot be securely hosted!"

Using an iframe to the game on a different domain, browser's cross-domain security restrictions kick in making the game secure even for untrusted content. This is how our own arcade works, and it prevents the game from accessing the parent page or site at all, ensuring user accounts and data are secure. This is the standard way to securely host a HTML5 game. HTML5 iframe sandboxing improves security even further.

"HTML5 won't be done until 2022!"

This is oft-repeated nonsense which ZDNet Asia call a myth. As the 2011 article states: "The truth is that 2022 is when Hickson expects the HTML5 spec to become a full W3C recommendation, which means that there are two 100 percent complete, verifiable implementations... consider that no other version of the HTML spec has ever achieved that status... the HTML5 specification is getting close to being solidified and unchanging, right now in 2011." The confusion comes from 2022 being the date Ian Hickson (the HTML5 spec editor) predicted for two separate browsers implementing the specification flawlessly, which can come a long time after the spec being "done" since bugs and tweaks are to be expected in software. That's very different to the HTML5 spec being ready, and much of it is implemented and usable in all modern browsers today. If you have any doubt if HTML5 is usable today, head over to our arcade and play some games!

"You can't do fullscreen games!"

I'm not sure where this misconception came from, because for years you've been able to hit F11 (or some other shortcut) and switch the browser in to fullscreen mode. In Construct 2 games, just make sure you're using one of the fullscreen-in-browser settings so the game fills up the whole window. Better yet, the Browser object also supports automatically entering fullscreen mode (use the 'Request fullscreen' action), which works in the latest Chrome and Firefox.

"HTML5 is a fad and it's not going anywhere!"

This is a fairly opinionated statement so it's hard to answer objectively. However, with Adobe switching focus to HTML5 tools, Microsoft integrating it in to Windows 8, Google working on a whole OS based on a browser, both Google and Mozilla working hard to make HTML5 apps just like native apps, and browsers increasingly going plugin-free (as with iPhones, iPads and Windows 8 tablets), I think it's difficult to argue that it's just a fad - I would say it's here to stay, and will be around for a long time to come as well.

It's always interesting to see carefully thought-out articles and opinions on the subject, and it's exciting to ride the wave of a new technology. So please do get involved! Just be aware of misinformation or out-of-date arguments (since HTML5 is fast advancing), or those arguing points which Construct 2 has already solved for you. They don't matter. I see many of the above points trotted out time and time again across the web, and they range from simply false to being something that Construct 2 solves for you. So as you're reading on the subject, remember: we're working hard to make it work for you!

Now follow us and share this



Jailson 12.9k rep

nice answers to fight trolls!!!

Wednesday, February 22, 2012 at 3:55:27 AM
DiscoFish 7,238 rep

Thank you! It was interesting to read.

Wednesday, February 22, 2012 at 3:55:56 AM
ElCapitan 5,599 rep

Nice article, HTML5 is booming!

Wednesday, February 22, 2012 at 4:00:58 AM
tavitooo 5,234 rep

Thanks and Nice article! it was interesting to read guys!. Thanks so much!!!!!!!!!!!!11

Wednesday, February 22, 2012 at 4:08:03 AM
Kiyoshi 13.4k rep

Nice article ! What would be of us without C2 ? :D

Wednesday, February 22, 2012 at 4:13:00 AM
Ingevar 2,140 rep

Great article! Thanks!
I think it always depends on what are you going to do right now and what game would you like to do, how much money you can spend on making it. You can use Unity, Flash or HTML5 - with all advantages and disadvantages.
The main thing for us I suppose - with Construct 2 I could focus on game-design itself :)

Wednesday, February 22, 2012 at 6:08:30 AM
arevirlegna 3,809 rep

It is also the case that the bar on UX/UI has been raised so high that it is almost impossible, in practical terms, to develop HTML5 apps from scratch and that our dependence on tools like Construct2 will become almost imperative.

Wednesday, February 22, 2012 at 6:35:03 AM
Wastrel 11.9k rep

Nice post. It's always comforting to see how well you've thought out your strategy for C2. Every blog post, forum response, and application update reflects your maturity and dedication to a quality product. Keep up the great work!

Wednesday, February 22, 2012 at 9:35:59 AM
prinsukun 5,172 rep

Yet another interesting read :D

Wednesday, February 22, 2012 at 9:54:24 AM
Indoda 1,032 rep

Very interesting and informative thank you

Wednesday, February 22, 2012 at 10:08:02 AM
Bigheti 17.3k rep

I believe that HTML5 is here to stay. Large corporations like Google, Microsoft and Adobe would not be focusing some of its products in HTML5 if it did not have a future. Thanks for the arguments presented above that helps us to verify the credibility and seriousness work of the Scirra Team and this wonderful software: Construct 2!

Wednesday, February 22, 2012 at 10:54:14 AM
shinkan 36.8k rep


Wednesday, February 22, 2012 at 12:18:39 PM
Geo 5,675 rep

I agree, this is great stuff. But one thing I got from a Flash developer just recently is this: you can't site-lock a game.

Any thoughts on how this might be done? SITE LOCKING?

Wednesday, February 22, 2012 at 12:25:52 PM
Go2Holidays 2,383 rep

I'm looking forward to the PhoneGap/AppMobi improvements in C2. The main 'problem' area I've found with C2 is the poor audio support on various mobile browsers. I'm not sure why, but building a C2 game and exporting for PhoneGap just doesn't play sound on Android.... despite the JS attempting to use the PhoneGap code??

Wednesday, February 22, 2012 at 12:29:36 PM
ludodesign 30.7k rep

Thank you @ashley

Wednesday, February 22, 2012 at 1:26:17 PM

Leave a comment

Everyone is welcome to leave their thoughts! Register a new account or login.