Platform game (not finished)

I’ ve made an applet version of a game that I coded with some friends for our first java course at university.

It’s a bit big, but if you’re on a fast internet connection it shouldn’t be that much of a problem (I hope?).

Here it is: http://www.idi.ntnu.no/~erlinga/frogma/frogma.php

It’s still a bit buggy, and lacking display of status information. Menus are also to be added.

I’m in need of a graphics artist, as most of the current graphics are ripped from old Super Mario games… I don’t know how legal that is :stuck_out_tongue:

Reports ‘Unable to load image images/stars2.png’ and
throws a NPE after saying something like ‘ferfig a sette level’, but after a short time the game appears and runs very smooth.

It should work now. Some of the image files had gotten file names in upper case.

If you experience timing problems it’s because I can’t use the native timer dll in the applet. It should run pretty smoothly anyway (but sometimes too fast).

this game is great!! I love it, just like mario but faster. Way cool!

One of the better games on these boards.

[quote]It should work now. Some of the image files had gotten file names in upper case.
[/quote]
Confirmed.

I cannot see timing problems.

Are you using the Sleep Timer hack in the Shared Code on this forum?

I recieved the following error from the java console on IE:


Error loading class: FrogmaApplet
java.lang.NoClassDefFoundError
java.lang.ClassNotFoundException: FrogmaApplet
      at com/ms/vm/loader/URLClassLoader.loadClass
      at com/ms/vm/loader/URLClassLoader.loadClass
      at com/ms/applet/AppletPanel.securedClassLoad
      at com/ms/applet/AppletPanel.processSentEvent
      at com/ms/applet/AppletPanel.processSentEvent
      at com/ms/applet/AppletPanel.run
      at java/lang/Thread.run

Nice old school fun :slight_smile:

I like it a lot

[quote]I recieved the following error from the java console on IE:


Error loading class: FrogmaApplet
java.lang.NoClassDefFoundError
java.lang.ClassNotFoundException: FrogmaApplet
      at com/ms/vm/loader/URLClassLoader.loadClass
      at com/ms/vm/loader/URLClassLoader.loadClass
      at com/ms/applet/AppletPanel.securedClassLoad
      at com/ms/applet/AppletPanel.processSentEvent
      at com/ms/applet/AppletPanel.processSentEvent
      at com/ms/applet/AppletPanel.run
      at java/lang/Thread.run

[/quote]
Which java runtime version are you using? Is it the MS VM?? You should use Sun’s VM, 1.4.0 or above.

Wow, that was pretty decent. My only complaint is that it ran TOO fast, but I’m definitely impressed.

Michael Bishop

Well, looks like I’m the only one for whom this didn’t run well. Bummer. It was extreemly slow. Perhaps I’ll try it on my home machine after work.

When I’m using Runtime to get the free amount of memory vs. the total amount, it seems the application version is always using between 80 and 126 MB of memory, regardless of the size of the level, game object count, etc. I have no idea why.

Can I trust Runtime on this matter, is the game really using that much memory? If so, it would perhaps explain why the applet was so slow?

??? ???

Well on my home machine this is so fast I can’t even control the thing. Is there any timing code in here at all? It looks like it would be fun to play, but I either get incredibly slow or incredibly fast.

There is some Bad Timing Code… The FPS seems to vary between 30 and 50 when I run it with size=400*300. In the applet version of the game, I only use currentTimeMillis and thread.sleep. I’m painfully aware of the limited resolution of the timing resulting from this, seems I’ll have try the timing hack that was mentioned here.

OK I’m trying to use the SleepTimer hack, but I can’t figure out how to use it… ??? ??? My FPS counter goes wild too.

I’ve updated the applet a bit now, the collision detection should be better. The timing, however, I can’t figure out how to do right. The ‘sleep timer hack’ seemed to slow the applet down too much. I don’t know if I’m using it correctly.

My code looks like this:

t1 = sleepTimer.getTickCount();
// do stuff here
t2 = t1;
while(t2==t1){
t2 = sleepTimer.getTickCount();
}

Is this very wrong? After reading the sleeptimer hack code, I got the understanding that it’s only supposed to ‘tick’ once every frame? If I need to add any thread.sleep’s in there, wouldn’t that ruin the precision?

Few things. I want to compliment the level designers first of all. Second of all, Could you make it so that I can start at a certain level if I have a password? I made it to level 3, and that was so hard.

I used the SleepTimer in my Pacman demo. Look at the GameBoard.java class at http://www.mindspring.com/~bishopmw/pacman/pacman.zip

The run() method is where it’s initialized and used.

Michael Bishop

I generally keep Microsoft’s VM on by default. If you require the Sun plugin you might want to web enable your applet using the HTMLConverter supplied by Sun. Doing that will force the use of the plugin over a browser’s default virtual machine. This is nice for not only Internet Explorer users but also individuals using Netscape or older versions of the plugin.

http://java.sun.com/products/plugin/1.3/devinfo.faq.html#auth