Tuesday, October 15, 2013

Scoring Update

I've put a new version of ZOMG Rockets! up on Kongregate.  What's changed?

UI changes - mostly new font:

Kongregate API tracking of:
  • High scores (level and game)
  • Kill streaks
  • Level completion times
The game actually ends (3 lives - once you're done, you're done).

You can play it here.

Adding support for the Kongregate stats API was actually remarkably simple.  After setting the stats you want to track on the Kongregate site, there are two steps:

There's a single function call to link to the Kongregate API at game start:
Application.ExternalEval( "if(typeof(kongregateUnitySupport) != 'undefined'){" + " kongregateUnitySupport.initAPI('ExternalAPI', 'OnKongregateAPILoaded');" + "}" ); And then a single call for each event you want to report:
Application.ExternalCall("kongregate.stats.submit", eventName, eventValue); eventName is any string, and eventValue is any non-negative integer.

PS:  If you know why my code blocks are word wrapping even though I've set white-space: pre, please tell me! :)