Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
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 4344 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: 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:, 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: 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
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
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  

EgonOlsen (74 views)
2018-06-10 19:43:48

EgonOlsen (55 views)
2018-06-10 19:43:44

EgonOlsen (74 views)
2018-06-10 19:43:20

DesertCoockie (254 views)
2018-05-13 18:23:11

nelsongames (154 views)
2018-04-24 18:15:36

nelsongames (154 views)
2018-04-24 18:14:32

ivj94 (895 views)
2018-03-24 14:47:39

ivj94 (156 views)
2018-03-24 14:46:31

ivj94 (808 views)
2018-03-24 14:43:53

Solater (172 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!