Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (575)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Kongregate API for Java  (Read 1820 times)
0 Members and 1 Guest are viewing this topic.
Offline Mac70
« Posted 2013-01-06 17:51:00 »

Kongregate API for Java

Current version of API is 0.3, it allows you to:
  • deploy your Java game on Kongregate easily
  • check if player have needed version of Java, show popup if not
  • simple testing/guest mode
  • get player name (or information that player is a guest)
  • send statistics to Kongregate
  • add your own functions easily
Code is not secured in any way - you can modify it (or even must!) if you want.

Instructions how to use Kongregate API:



LWJGL game

1. Make new class somewhere in code, name it API and paste this code: http://pastebin.java-gaming.org/5c444707b34 then initialize this class in your init class. It must be public static like "public static API api;".
2. Do you have server? If not, you can use Dropbox Public/<your_game_folder> to store your game files.
3. Put game .jar and all libraries to this folder.
4. Make new file "KongregateShell.html" in this folder and paste this code: http://pastebin.java-gaming.org/df781027735, fill YourGameWidth and YourGameHeight with proper values (+20 pixels for each value or your game will have scrollbars on both sides).
5. Make new file "Frame.html" in this folder and paste this code: http://pastebin.java-gaming.org/c44408b7432. Fill it with appropriate values and modify if needed.
6. Everything is ready! Now you can add new game to Kongregate. Copy "KongregateShell.html" public link and paste it in second step of game uploading as IFrame.
7. Please make sure that all jars are signed.

Player name is ready to use in about second after game is fully loaded.
You can use Kongregate API by calling public void setRequest(String type, String name, int val). Currently as type you can use only "score" which will send statistics to Kongregate. Please make sure that earlier you initialized new statistic in Kongregate API system.



Tips for new Kongregate developers:
  • Try to add as much statistics as possible (these may be invisible in leaderboards - just add them, because this allows your game to get badges if rating is high enough). And remember - most players love stats, so just adding them may make your game much more popular. Wink
  • Avoid "Add type" statistics - these are sensitive to bugs and connection errors.
  • Report statistics often, possibly even all of them at the same time. Don't split stats code across all classes, store them in single class and call it.
  • If your game have difficulty levels - MAKE STATISTICS SEPARATE FOR EACH SETTING!
  • Try to add invisible (or visible) statistics for all things that may get badge from Kongregate, like game finished, earned money, level 10 finished in 40 seconds etc.



Work in progress:
-virtual goods API
-offline/testing mode
-Java version checker and warnings displayer

Check out my Devblog! Smiley
Offline Mac70
« Reply #1 - Posted 2013-01-06 18:32:35 »

Version 0.2 is ready - now you can send more than one statistic at the same time, up to value of variable maxRequests in API. Smiley

Frame.html and API class updated.

I hope that this API will help Java games become popular on Kongregate. I would love to see more Java games there! Cheesy

Check out my Devblog! Smiley
Offline tman140

Innocent Bystander





« Reply #2 - Posted 2013-03-14 18:12:32 »

Does it require LWJGL? i made my own game from scratch.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (35 views)
2014-10-17 03:59:02

Norakomi (26 views)
2014-10-16 15:22:06

Norakomi (24 views)
2014-10-16 15:20:20

lcass (26 views)
2014-10-15 16:18:58

TehJavaDev (50 views)
2014-10-14 00:39:48

TehJavaDev (52 views)
2014-10-14 00:35:47

TehJavaDev (40 views)
2014-10-14 00:32:37

BurntPizza (63 views)
2014-10-11 23:24:42

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (76 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!