Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (495)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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  
  Purpose of Slick Test Classes  (Read 2652 times)
0 Members and 1 Guest are viewing this topic.
Offline DoubleBarrel

Senior Newbie





« Posted 2011-01-31 20:52:42 »

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.

And Java Goes On
Offline kevglass

JGO Kernel


Medals: 164
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #1 - Posted 2011-01-31 22:18:55 »

Most of the tests have a main() method. They're intended to be run as programs.

Kev

Offline DoubleBarrel

Senior Newbie





« Reply #2 - Posted 2011-01-31 22:38:58 »

silly me :/ thanks a lot though Smiley - If I can add another question Grin 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 ...>
<param name="al_main" value="classes.framework.CentralControl">
</applet>

Is this the correct way of doing things?

And Java Goes On
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 77
Projects: 15


★★★★★


« Reply #3 - Posted 2011-01-31 22:50:48 »

Then I'm writing this in the the html file displaying the applet:
<applet ...>
<param name="al_main" value="classes.framework.CentralControl">
</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.
Offline DoubleBarrel

Senior Newbie





« Reply #4 - Posted 2011-01-31 23:09:50 »

Awesome Smiley 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

And Java Goes On
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 77
Projects: 15


★★★★★


« Reply #5 - Posted 2011-01-31 23:24:36 »

your resources should be inside a jar which in turn should be on al_jars.
Offline DoubleBarrel

Senior Newbie





« Reply #6 - Posted 2011-01-31 23:54:55 »

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

And Java Goes On
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 77
Projects: 15


★★★★★


« Reply #7 - Posted 2011-02-01 00:21:48 »

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.
Offline DoubleBarrel

Senior Newbie





« Reply #8 - Posted 2011-02-01 00:46:06 »

Thanks again Smiley Everything is working fine. Applet loaded and working well

And Java Goes On
Offline DoubleBarrel

Senior Newbie





« Reply #9 - Posted 2011-02-01 01:04:45 »

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 Smiley just forgot to add the files referred to from the xml file in the same directory Smiley -- thanks again

And Java Goes On
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.

Dwinin (28 views)
2014-09-12 09:08:26

Norakomi (57 views)
2014-09-10 13:57:51

TehJavaDev (73 views)
2014-09-10 06:39:09

Tekkerue (37 views)
2014-09-09 02:24:56

mitcheeb (57 views)
2014-09-08 06:06:29

BurntPizza (44 views)
2014-09-07 01:13:42

Longarmx (27 views)
2014-09-07 01:12:14

Longarmx (34 views)
2014-09-07 01:11:22

Longarmx (34 views)
2014-09-07 01:10:19

mitcheeb (40 views)
2014-09-04 23:08:59
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!