A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: [F8] Creating a high score API?

  1. #1
    Senior Member
    Join Date
    Jul 2006
    Posts
    150

    [F8] Creating a high score API?

    Hi I've seen this being used in Kongregate and Hallpass where the loaded games automatically have _root functions to load and save hiscores. Can someone steer me in the right direction where I can do something like this?

    I thought it was a just a loader but then I read that the child MovieClip must be the same framerate as the parent. I don't think it's Javascript either.

    Thanks!
    Tony

  2. #2
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Uploading game does not itself provide any highscore API, the highscore code must be included in your swf. Maybe I am just not understanding your question, are you wondering how to write your own highscore system or how to include one from those sites in your games?

  3. #3
    Senior Member
    Join Date
    Jul 2006
    Posts
    150
    Yes I need some guidance on making something that takes any game and adds hiscore functions to it automatically. I am sure Kongregate uses something like that, I upload my game and use their API without even having the source code of the functions like "_root.saveHiscore(..)", then once I upload it, those functions just work.

    I thought of making a preloader with those _root functions but I read that the parent movie changes the framerate of the child.

    Thanks!

  4. #4
    Pumpkin Carving 2008 ImprisonedPride's Avatar
    Join Date
    Apr 2006
    Location
    Grand Rapids MI
    Posts
    2,377
    I've been looking into this myself. I've been watching a place like Nitrome.com. From what I can tell, they use a container that has the functions built in. This is most noticeable in how every game has a global mute sound/music and a few other global options in the corner of the game.

    I've actually been working on writing a class that loads a SWF/included movieclip that you just give a url/pass to when you create the class object. Optionally I've wanted to add some level of security, but I think that really depends on what database utility you're using (mySQL, etc).
    The 'Boose':
    ASUS Sabertooth P67 TUF
    Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
    8GB G.Skill Ripjaws 1600 DDR3
    ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
    New addition: OCZ Vertex 240GB SATA III SSD
    WEI Score: 7.6

  5. #5
    Now tell me whos watchin...... samvillian's Avatar
    Join Date
    Feb 2007
    Location
    Where do you live?
    Posts
    539
    just a little heads up, mochiads has a leaderboard now.

  6. #6
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Quote Originally Posted by Gamebrew
    Yes I need some guidance on making something that takes any game and adds hiscore functions to it automatically. I am sure Kongregate uses something like that, I upload my game and use their API without even having the source code of the functions like "_root.saveHiscore(..)", then once I upload it, those functions just work
    Kongregate highscore API uses localConnection to exchange data with chat swf on the same page. All the actual user identification and exchanging data with server is handled by the chat swf.

  7. #7
    Senior Member
    Join Date
    Jul 2006
    Posts
    150
    Thanks, localConnection looks like it can work. But can one SWF give _root functions to the other SWF to save hiscores, or even code to mute? The only two lines you need to save hiscores is something like _root.init() and _root.save(score,name)

  8. #8
    Senior Member
    Join Date
    Nov 2003
    Location
    Las Vegas
    Posts
    770
    I'm hoping someone makes UHAPI (I like that, makes u happy), or a Universal Highscore API. It would be great if MochiAds made the API available to the portals. It would be so much easier to include a single UHAPI rather than publishing for each portals API. Of course, security would be the main issue.

  9. #9
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Well, if you use MochiAds, you may as well include their leaderboard API which works everywhere you have uploaded the game.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center