Skip to content

Kongregate

MrStahlfelge edited this page Jul 18, 2017 · 13 revisions

Kongregate is a game page for serving Flash and HTML5 games and by that capable to distribute libGDX GWT games. It is mainly interesting for its good monetization: Players have to view an ad before the game starts, the revenue is around 1 ct per 10 plays.

Overview

Kongregate provides a working JS library for accessing its API. So the KongClient is very lightweight.

Kongregate API supports the following features:

  • Leaderboards (called Highscore)
  • Events (called Statistics)

Kongregate grants achievements to users - they are called badges -, but you are not allowed to define them yourself. If your game is a chosen one, Kongregate Team will define badges for it based on your events/statistics. Best approach is to define statistics for your achievements, and for that KongClient calls submitEvent with value 1 when you callunlockAchievement().

Configure your Kongregate game

You define the events and scoreboards via its "Statistics" page. Add /statistics to your game url and go on.

See also: http://docs.kongregate.com/docs/concepts-statistics

Usage in your libGDX project

Include the Kongregate implementation in your build.gradle for your HTML5 project:

    compile "de.golfgl.gdxgamesvcs:gdx-gamesvcs-html-kong:$gamsvcsVersion"
    compile "de.golfgl.gdxgamesvcs:gdx-gamesvcs-html-kong:$gamsvcsVersion:sources"

Add Kongregates library to your webapp/index.html:

   <script src='https://cdn1.kongregate.com/javascripts/kongregate_api.js'></script>

Now you can use KongClient in your HTMLLauncher class. You don't need any initialization, Kongregate's JS library does it all.

What work is undone?

  • Callback for Kongregate login and show registration box not implemented
Clone this wiki locally