oh, I see the issue, your main class needs to be an Applet. Currently its an Application and that is why its failing.
You need to refactor your main class into an Applet or create a new Applet class along side your Application class.
Have look at the LWJGL Wiki for an example of a what a Basic LWJGL Applet should look like. Its not very different or difficult to convert a LWJGL Application into a LWJGL Applet.
What more keys would you like? See the README, or F1 for Help.
There’s a new version, with better AI and joystick handling. Try my favorite levels, 6 and 14 (select through left/right on the title screen).
I got my applet working, pretty smooth when fullscreen. But the initialization takes close to a minute,
after the LWJGL progressbar has finished that is. When I run the applet in Eclipse there is no waiting, like when running as an application.
The problem seems to be:
InputStream is = Sprite.class.getClassLoader().getResourceAsStream("tiles/" + ref);
It does this for every tile in the background, which is 16 x 28…
Tiles are only 20 by 22 and about 1KB per tile (PNG). Why is this so slow?
Update: I now just generate them from 1 big getResourceAsStream, saves 45 seconds! I would still like to know why getResourceAsStream is so slow though. I’ll have to rewrite getting the other sprites and levels within 1 read too, that should save another 10 seconds or so. Bit of a hassle since it is not really an option for the application version, where you can make your own levels, so I have to keep the old code too…
Yep it did, but alt-tab didn’t even work to get out of the game when it black-screened. Had to ctrl-alt-del -> task-manager to get out of it, so it might not be the way for general population to switch
Tested the applet version as well. It sort of worked, but the up key was “stuck”, so that made a challenging game even more challenging Quite interesting to find ways to solve it… Tested on both FF and chrome, Win7
The applet version starts windowed (within the browser that is). What happens if you go fullscreen (guess that works) and then back again?
Hmm, I have that with a wrongly calibrated joystick sometimes, otherwise this is new to me…
Just found out I had I wrong link in the opening post, guess you knew where to find it?
Could you test the latest version, see if the loading time has improved for you? (you can browse java-expert.nl/games/ to see modification times, to see if you’re testing a newer version : )
Never thought of testing that… Went to fullscreen OK, but black screen again in the way back, but this time I could at least alt-tab away from it. This could naturally have something to do with it:
java.io.FileNotFoundException: LodeRunner.cfg (Access is denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
at loderunner.Config.write(Config.java:40)
at loderunner.Game.getInput(Game.java:842)
at loderunner.Game.renderFrame(Game.java:457)
at loderunner.Game.gameLoop(Game.java:442)
at loderunner.Game.access$0(Game.java:435)
at loderunner.Game$1.run(Game.java:67)
Could be. Tried to control it with wheel, but no luck
Ye, hacker I am
Didn’t think about loading time first time around, so was probably not too bad then, but really fast now at least.
Press ‘F’. Unless you mean in the code, then it’s the same as in the application version, I just do ‘Display.setFullscreen(fullscreen);’ (which happens to toggle between true and false). Switching back should work now too. Only problem is I lose the mouse focus, haven’t figured out how to get it back. The user will have to click the playing window first… (unless he/she is using a joystick, that doesn’t seem to need focus.
I guess I need to mention F1 somewhere, I don’t want it to show permanently on the Titlescreen though.
Any idea about the sounds? A new version is available, maybe try that? Loading time is now down to 7 or 8 seconds, and it shows the Titlescreen after 2
Hmm, doesn’t trouble my system. Is there a way to test if the prog is running as an Applet or Application?
It asks for calibration now, if it sees it will go haywire If you still have a ‘stuck’ key, you probably need to disconnect any controller (except the keyboard and mouse of course).
Cool. I’m just trying to get webstart to work. Lode Runner Retro Webstart
Seems to work for Windows (32). Not sure about Linux though, could someone test? For some reason I can’t get it to work, but don’t get an error… (it seems to download native_windows.jar?)
Update: Wine had associated itself with webstart Aarrrggghhh
Worked fine on win7 64-bit.
Although there were no problems, I think full-screen for testing these small games are a bit scary. I’d much rather go with windowed so if anything screws up, I have control of stuff.