O'Reilly logo

HTML5 Game Development from the Ground Up with Construct 2 by Roberto Dillon

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

199
Chapter 12
Deployment and
Monetization
I
    are going to introduce several platforms we can
deploy our HTML5 games to, together with dierent monetization
strategies. Note, though, that the aim here is only to give an overview
of the dierent options and point you in the right direction, which you
will then have to investigate on your own: since most of the discussed
platforms and tools are constantly evolving, trying to get into the details
would not only be too advanced and o topic for a foundational book like
this one, but it would also be pointless since any extensive step-by-step
description would very likely be outdated and not applicable anymore as
soon as an update is released. For such detailed information, I recommend
that you check each tool, vendor, or portal website for the latest documen-
tation and ad hoc tutorials.
By selecting Export project from the main drop down menu, we get
several options, including web, mobile, and desktop platforms. Construct
being an HTML5 engine, the rst option we should talk about is to simply
export our projects as HTML5 games to be added to our own websites.
If so, we will rst be asked a set of options (Figure12.1), common also to
the other platforms, where we can specify folders and whether to “minify
our script. Selecting this option will make our exported code much more
dicult to read, and it is usually recommended for games to be delivered
online if we don’t want other people to easily peek into our code base.
Note, though, that this option may conict with some target platforms,
200  ◾    HTML5 Game Development from the Ground Up
so be sure to check whether there could be any issue, or try leaving this
unchecked if the exported game doesnt run.
Once you click Next, we move to a platform-specic set of options. In
case of a straightforward HTML5 game export, we can choose between
three dierent templates (shown in Figure12.2): a standard page, a page
FIGURE 12.2 e second set of options. is is platform specic: when doing a
straight HTML5 export, we can choose among dierent templates for the page
containing our HTML5 game.
FIGURE 12.1 e rst set of export options, common to all target platforms.
Deployment and Monetization  ◾    201  
with some built-in empty space to easily add advertisements, and an
embed template with no margins and disabled scrollbars, suitable for spe-
cic arcade-like web portals.
Try any template, export, open the game folder, and launch the result-
ing index.html webpage in the web browser of your choice. Your game is
ready to be uploaded to your server!
12.1 WEB PORTALS
Uploading to our own website is only one of the many choices we have:
with HTML5 growing in popularity, more and more web-based gaming
portals are being launched, oering increased exposure and driving thou-
sand of players straight to our games.
One of such portals is Scirra’s own Arcade
*
(Figure12.3).
*
http://www.scirra.com/arcade
FIGURE 12.3 Scirra’s Arcade home page: we can see games are grouped in dif-
ferent categories (Action, Puzzle, Shooter, etc.) as well as featured and top-rated
games.
202  ◾    HTML5 Game Development from the Ground Up
Submitting to Scirras Arcade is a very simple process: by choosing the
corresponding export option our game is zipped and ready to be uploaded
right aer the exporting process has been completed. Note that Scirra’s
Arcade also oers leaderboard functionalities. To access these we need to
add the Scirra Arcade object to our project rst and use its related events
and actions to submit and retrieve scores: once the rst few scores get sub-
mitted, a high score table will be automatically displayed on the game page
for all to see!
One of the most well-known web-based game portals is, without doubt,
Kongregate
*
(Figure12.4).
is portal hosts a huge variety of games (more than 70,000 games
freely playable developed in Flash, Unity, and HTML5) and managed to
build a very active community thanks to its many ways of engaging players
through challenges, badges, and leveling systems.
*
http://www.kongregate.com/
FIGURE 12.4 Kongregate home page, sporting an impressive amount of players
(tens of thousands online at any given time) and available games.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required