Html5 game licensing?


I’m completely new to html5 game development, so I was wondering if someone could explain to me how licensing of html5 games works.

The reason I’m asking, is that I uploaded my game to Newgrounds in the hope of earning some coffee-money from ads. But to my surprise, just a couple of days later, my game was running on all kinds of game aggregator sites (with ads). I don’t mind for this first game, that other people are making some money from it, but it raises the question of how one can support oneself with html5 games.

That’s when I came across the term ‘licensing’. How do those companies prevent the games they are selling / renting out from being published all over the web ? :thinking:


I think that “site locking” is a primary method used to prevent distribution of a game, you check in your code and prevent the game from running if it is not what you expect.

Now, the trick is doing so in a way that people won’t be able to easily bypass/strip from your code


On the flash target, it was possible to sitelock if needed and obfuscate to protect your intellectual property, I used to use SecureSWF to do this. It would make it much harder for someone to decompile the .swf and make changes to, or copy the game

Unfortunately, due to the nature of the HTML target, it’s futile to protect your code. you could sitelock, obfuscate, and minimize your .js , but at the end of the day it’ll still be a text file that anyone can copy and edit.


Isn’t code in haxe->js already “compiled” and unreadable? I think it’s really hard to edit anything outside of haxe source. Isn’t it?


Mmm … yes.
That makes html5 games mostly ‘throwaway’ things. I wish there was something binary (non-text) that could take the place of flash …


Not actually sure about this but maybe webAssembly?


Haxe -> JavaScript output is very readable :slight_smile:


class Test {
    static function main() {
        trace("Haxe is great!");


// Generated by Haxe 3.4.4
(function () { "use strict";
var Test = function() { };
Test.main = function() {
	console.log("Haxe is great!");


Some options I found:

If there’s something stable (and not licensed), we could wire it into our standard build.

There might be some stuff we could try from the NPM world


well, it’s time to make some obfuscation… :grinning:


@singmajesty… That would be a great Idea if obfuscation is included in a build. Minifyng the js doesn’t guarantee that it is secured… Anyway hope this will be part in a future… thanks