Hi guys:) How does one exactly use the test classes in the Slick2D API. What I am referring to is class ParticleTest. I have tried instantiating a new object: new ParticleTest(), everything builds but nothing happens. Nyways, I still managed to set up a particle system but would really like to know how to use the test classes for future use. Thank you millions.
Most of the tests have a main() method. They’re intended to be run as programs.
Kev
silly me thanks a lot though - If I can add another question ;D I’m trying to upload my work and have set an applet tag containing all the necessary tags following the tutorial at ninjacave http://ninjacave.com/appletloader1. Yet I am given an error “An error occured while loading the applet … This occured while ‘switching applet’”. What I am suspecting is that the applet loader is not finding the package that contains the main class of the game.
I have built my game in netbeans and copied the following folder: “build\classes” from the netbeans project folder and pasted it into the folder containing all the other jars the applet loader is using. Then I’m writing this in the the html file displaying the applet:
<applet …>
Is this the correct way of doing things?
when using slick you don’t put you own class in al_main, instead you should put it in the “game” parameter. Have a read of this.
Awesome all errors have disappeared. Yet I think I have one final obstacle. I have done the following changes:
I took the jar file of my game from the dist project folder.
I loaded this jar file from tag <“al_jars”>
In the <“game”> I 'm specifying my main class.
What happens however is that there is an initial black screen which then disappears.
I think the folder in which the game resources(pics and stuff) reside is not included in the jar file. Where should I paste this file so that it is readable from the applet?
Many thanks
your resources should be inside a jar which in turn should be on al_jars.
just now I find that jar command not recongnized on me command prompt doh but can still put folders in jar using the full path to the bin jdk folder
jar’s are just zip files, much easier to just use something like Winrar/7-zip to create the zip file and rename it to jar, or better yet use your IDE to do it.
Thanks again Everything is working fine. Applet loaded and working well
Are xml files treated like other game resources? -everything is fine except a particle system which works well when run as a stand alone application but doesn’t run at all -as if it didn’t exist - when run as an applet in the browser. The only thing I can imagine is happening is that the xml file containing the configurations of the particle system cannot be read from the jar file for some reason, yet all the other resources are loaded just fine. Thanks and sry for asking a lot.
–solved as well just forgot to add the files referred to from the xml file in the same directory – thanks again