Posts Tagged ‘kongregate’

  • Using Flixel 2.5 and the Kongregate API

    Versions of Flixel before 2.5 had a handy little class called FlxKong, which neatly wrapped-up the Kongregate API and made it simple to use in your games. It was dropped in the 2.5 release however, and with the introduction of the new camera system and modified display list it made it a bit harder than before to get working. I wrote my own class to get around it, but after some posts on the flixel forums asking for help I figured it made sense to package my class into the Flixel Power Tools and release it.

    At the time of writing the class is only in the dev branch on github, but is pretty much feature complete and ready for use. Using it is simple, just import the class:

    import org.flixel.plugin.photonstorm.API.FlxKongregate;

    .. and then init the API. This downloads the Kongregate API SWF from their server and stores it locally for use:

    FlxKongregate.init(apiHasLoaded);
    
    private function apiHasLoaded():void
    {
    	FlxKongregate.connect();
    }
    

    The “apiHasLoaded” function is your own, it will be fired once the API SWF is downloaded. When this happens you can connect to it as above. The connection is pretty much instant, and you then have access to all of the API functions which I’ve exposed via the class, such as:

    FlxKongregate.isLocal
    FlxKongregate.isGuest
    FlxKongregate.getUserId
    FlxKongregate.getUserName
    FlxKongregate.showSignInBox
    FlxKongregate.showShoutBox
    FlxKongregate.submitStats
    
    etc etc 
    

    Also the api object itself is available via FlxKongregate.api, so you can call any service they have that I’ve not yet exposed in this class.

    There is a Test in the Demo Suite which shows how to use it. Here’s a direct link to the as file.

    Lots of the Kongregate API only works when your game is actually run on Kongregate itself. And equally lots of it such as micro-transactions don’t work at all unless your game is part of their private beta test. So don’t go calling functions randomly! Do check their documentation first.

    Using FlxKongregate without the Flixel Power Tools

    I fully understand if you don’t want to include the whole of my Power Tools library just to use this one class. So here’s how to make it run stand-alone:

    Download the FlxKongregate.as file from github and copy it into your src folder.

    Open it into FlashDevelop (or whatever editor you use) and edit the package. FlashDevelop will even prompt you that the package is wrong and automatically correct it! The default is:

    package org.flixel.plugin.photonstorm.API

    But if you have copied it into your src folder, you should remove everything after “package”. Equally if you have placed it into your own folder, you should make the package line reflect this.

    Once you’ve done that you can use the API as normal.

    Have fun 🙂

  • Colour Chain Release Stats

    The game Colour Chain was officially released onto the Shaun the Sheep site 6 days ago, and has been going down well. The “Top 5 scores of the day” feature is proving a good draw / challenge. So far the game has had 6000 plays in 6 days (which is on par for the traffic levels we get). The average time someone spends playing the game is a very healthy 6 minutes 5 seconds.

    Wanting to experiment further I released Colour Chain onto Kongregate, Newgrounds and AddictingGames to see what the response would be like, and to get used to the submission process.

    I wrapped my game in a GameJacket so I could monitor its travels, prepared some screen grabs and let it fly.

    The game appeared on Newgrounds instantly (as an “Unapproved” title) and I was shocked to see it gain 300 plays in the first couple of hours. Newgrounds obviously has some serious traffic. It’s got a pretty good rating on Newgrounds (3.18 / 5.0) and the comments are surprisingly friendly. Not at all what I expected.

    Kongregate wouldn’t let me use my GameJacket version, so I had to upload a plain vanilla one and trust their stats. It still received 300+ plays within hours of release. The average rating is 2.64, which is totally fair, and the comments are mostly constructive which is nice.

    AddictingGames hasn’t released the game yet, so we’ll wait and see what happens. I’ll post again when I have some more stats to share.
    Play Colour Chain on Kongregate

    Play Colour Chain on Newgrounds