Build 10 games and learn game development along the way in this fast paced game development course

Get the source code of 12 commercial games, loaded 50+ million times, and learn the secrets of game design

Learn how to make a successful Flash game from a real world example. Fully commented source code

Create realistic Flash physics games from scratch with advanced features, from Angry Birds to Crush the Castle

Monetizing an HTML5 game with FGL HTML5 API – even if you are using Construct2

About a week ago I blogged about the experiment to monetize a game in the post MochiMedia era, and my experiment continues trying to get my HTML5 game Whack a Creep using one of the oldest services for game monetization: FGL which is also my favourite service.

You should already about FGL opportunity for HTML5 games, I also blogged about it in the post FGL will pay IN ADVANCE up to $200 for your HTML5 games.

You only have to download the API from the official page and use them in your game. There is a really simple yet complete documentation about the whole process, as well as a real world example with a Fruit Ninja game.

Unfortunately, if you made your game with Construct2 (like I did), there isn’t a plugin to easily add the API in the game, so I had to edit something here and there.

I am going to show you what I did in order to have ads, cross promotion and leaderboards in my Constrcut2 game.

First, you have to make some small changes to the index.html file generated when you publish your game: you can find them highlighted

Look how I changed the default file generated by Construct2:

Line 78: calling the javascript library you can find in the zipped file available in the official page

Line 87: API initialization

Lines 98-100: I am running the game only once the API is ready

This is all you need to code at the moment.

Now, a brief look at the Construct2 splash screen sheet:

Don’t mind about the two “On start of layout” events: I am just keeping them separated during debug process to easily activate/deactivate some actions.

This allows me to easily add both ads and cross promotion in the splash screen

Obviously this won’t automatically allow me to make money out of this game… now I have to submit it for approval, then sit, wait and hope – while making next game.

Stay tuned.

Rate this post: 1 Star2 Stars3 Stars4 Stars5 Stars (8 votes, average: 4.00 out of 5)
Loading ... Loading ...
Learn how to make a successful commercial Flash game from a real world example: get the fully commented source code of Globez, a Flash game played millions of times which generated a four figure income. Limited copies available.

Get it now
Be my fan on Facebook and follow me on Twitter! Exclusive content for my Facebook fans and Twitter followers

This post has 4 comments

  1. mobie developer

    on April 23, 2014 at 3:44 am

    here the plugin
    https://www.scirra.com/tutorials/961/implementing-the-new-fgl-12-api

  2. George

    on April 24, 2014 at 10:48 pm

    Looking forward for your next post about FGL. :D

  3. Jhaveri

    on April 29, 2014 at 12:12 pm

    Any change you could show an integration with GM Studio? Thanks.

  4. Making money with FGL and HTML5 games is even easier with the official Construct2 plugin - Emanuele Feronato

    on May 6, 2014 at 11:49 pm

    […] I had to tweak it a bit in order to make it work on Construct2, you can see how I did in the post monetizing an HTML5 game with FGL HTML5 API – even if you are using Construct2 when I had to use it into my Whack a Creep […]

Thank you for the download!!

I hope you will find it useful and make something interesting out of it

To keep up to date with the blog, why don't you like my Facebook page and follow me on Twitter?

Want to learn more? Don't miss this:

Learn how to make a successful commercial Flash game from a real world example: get the fully commented source code of Globez, a Flash game played millions of times which generated a four figure income. Limited copies available.

Get it now

×