Register/Sign in to be able to save high-scores and compete with others on-line. You can then also rate games, give feedback and gain rep.

Sign up


API available for applet developers

When you develop java applet and deploy them on Games4j.com, you have access to an API that let you fetch and store information about the game, the gamers and scores. This is still under development, so new versions of the API will be made available later on, and versions supporting other platforms will be made as well.

Get the latest api here DOWNLOAD

Usage

Import

import com.games4j.webAPI.*;

Check if a user is logged in

Useful to remind gamers to log in if they haven't

During start:

	boolean loggedIn;
	
		loggedIn = Highscore.isLoggedIn(applet);
		

In menu:

	if(!loggedIn) {
		g.drawString("log in to be able to save highscores!!!", xPos, yPos);
	}
		

Get highscore list

During start:

	private static List highscores = null;
	
		highscores = Highscore.getHighscores(applet, 1, 10);

In menu:

	if(highscores != null) {
		g.setColor(new Color(40,60,140));
		g.setPaint(new GradientPaint(0, 30, new Color(40,60,140), 0,300, new Color(40,140,60)));
		for(int i=0;i<highscores.size();i++) {
			HighscoreItem hsItem = (HighscoreItem)highscores.get(i);
			g.drawString(""+hsItem.getPos(), 30, 50+20*i);
			g.drawString(""+hsItem.getNick(), 110, 50+20*i);
			g.drawString(""+hsItem.getScore(), 250, 50+20*i);
			g.drawString(""+hsItem.getCountry(), 430, 50+20*i);
		}
	} 

Save score

	Highscore.save(applet, score [,level]);

About us   |    Add link to us   |    Contact us   |    Terms   |    Privacy   |    Submit game

(C) Copyright 2009 GAMES4J.COM All rights reserved.