Hey am trying to learn how applets work with lwjgl & slick, but i can't seem to get it working... Here are the steps i take -
- Export Game as "JAR file"
- get - slick.jar, lwjgl.jar, natives-win.jar & lwjgl_util_applet.jar... i put it on my desk top
- then i create a html file (notepad) the put the code it it.
this is the code i have in my html file -
<html>
<head>
<title>Applet Test</title>
</head>
<body bgcolor = "#222222">
<br><p>
<br><p>
<center>
<applet code="org.lwjgl.util.applet.AppletLoader"
archive="lwjgl_util_applet.jar"
codebase="."
width="800" height="600">
<param name="al_title" value="myslickgame">
<param name="al_main" value="org.newdawn.slick.AppletGameContainer">
<param name="game" value="Display">
<param name="al_jars" value="Animation.jar, lwjgl.jar, slick.jar">
<param name="al_windows" value="natives-win.jar">
</applet>
</center>
</body>
</html>my game code -
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| import org.newdawn.slick.AppGameContainer; import org.newdawn.slick.BasicGame; import org.newdawn.slick.Color; import org.newdawn.slick.GameContainer; import org.newdawn.slick.Graphics; import org.newdawn.slick.SlickException;
public class Display extends BasicGame { public static void main(String[] args){ try{ AppGameContainer app = new AppGameContainer(new Display()); app.setDisplayMode(800, 600, false); app.start(); }catch (SlickException e){ e.printStackTrace(); } }
public Display() { super("Applet Game"); }
@Override public void render(GameContainer gc, Graphics g) throws SlickException { g.setColor(Color.white); g.fillOval(150, 150, 50, 50, 5); }
@Override public void init(GameContainer gc) throws SlickException { }
@Override public void update(GameContainer gc, int delta) throws SlickException { }
} |
Error 'extracting downloaded packages'
Am not using any images in my code just appGameContainer using the Graphics to create an filloval
Cheers for taking a look
