Avalanche!

Hello all,

Thanks for all the help!

This is my frist java game and first post to this board.
This is simple game, but kinda cool.

ANY suggestions is much appreciated!!!

Webstart:
http://bookexchange.rh.rit.edu/games/avalanche.jnlp

Zip:
http://bookexchange.rh.rit.edu/games/avalanche.zip

Only tried it on winXP Pro with J2SE.

Use the left and right arrow keys to manuver your character across the screen. Try to avoid the falling fireballs for as long as you can. The longer you last, the higher your score.

Extract the files and pull up your command line:

Command line: java Avalanche

Webstart! Webstart! Webstart!

Cas :slight_smile:

Wow, thanks!

Already off to a great start :smiley:

I’m stuck - hahaha!

How do I modify the thing to get it to work with webstart. At first glance this is what I have…

<? header ("Content-Type: application/x-java-jnlp-file"); ?> <?xml version="1.0" encoding="utf-8"?> Avalanche! DAM Avalanche
  </resources>
  <application-desc main-class="Avalanche" />

Not working though. Any suggestions?? Tells me “nullpointer exception”. My game has NEVER reported that before and still doesn’t when I play on my system.

Update: Says “can’t load image.” Any generic reasons for that happening? Runs fine when compiled and ran on my machine. Something to do with images in a jar??
Images are saved in their own folder and the whole folder is then moved over to the jar.

Thanks!

Ahhh. Are you using ImageIO to load images? I fell foul of a bug in ImageIO. You have to wrap your getResourceAsStream in a BufferedInputStream to fix it.

Cas :slight_smile:

Cas,

You got it on the nose!

Thanks so much!!

I wish I could say this game was worth all the help! ;)Hahaha

Webstart didn’t do much still or yet? Just flahsed the usual popups and then vanished.

Tried the zip, but got:

Exception in thread "main" java.lang.UnsupportedClassVersionError: Avalanche (Unsupported major.minor version 49.0)
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)

Think I’ve seen this before… Can’t remember. Is this for Java 1.5?

Java 1.5?

Yes.

UnsupportedClassVersionError: Avalanche too.
We want 1.4 and webstart version (now) !

For JSE2 (1.5):
http://bookexchange.rh.rit.edu/games/avalanche.jnlp

Any suggestions on how to convert this to 1.4?? I have certain syntax (list templates) that won’t be recognized in 1.4.

(Thank you all for the help!)

got 4109 and got bored and killed myself. Make the ball’s speeds random each time they appear. Right now you generate randoms speeds at the beginning and never again. So I just found a pattern and jumped between the same 3 slots the entire game and found that I could play as long as I could keep my sanity.

Thanks for the idea.

As it stands, they reset every time you die.

Thanks for trying it.

Couldn't load image

java.lang.NullPointerException

      at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)

      at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)

      at sun.java2d.SunGraphics2D.drawImage(Unknown Source)

      at sun.java2d.SunGraphics2D.drawImage(Unknown Source)

      at AvalanchePanel.gameRender(AvalanchePanel.java:133)

      at AvalanchePanel.run(AvalanchePanel.java:223)

      at java.lang.Thread.run(Unknown Source)

+1, and before that I got :

java.security.AccessControlException: access denied (java.util.PropertyPermission webstarted write)

Probably some webstart problems still.

Also, if the game still needs 1.5 I don’t think it is good to have:

Maybe game already is 1.4+?

[quote]Also, if the game still needs 1.5 I don’t think it is good to have:

Maybe game already is 1.4+?
[/quote]
I just removed it… is that what you mean?

[quote]Couldn’t load image

java.lang.NullPointerException
[/quote]
I thought I ffixed that… Any more suggestions Cas?

In my experience Webstart (all versions, even 1.5) has no idea when to refresh a jnlp. On Windows XP SP2 and IE 6 the only way I’ve ever found to get Webstart to refresh a jnlp is to clear the game from its cache. I’ve even waited a full week to see if it would get out of date and download the new one and it didn’t happen. It’s retarded, but it might be what you’re experiencing.

Removing it has broken me.

Kev

And the lastest jnlp is broken ;D Looks like when damollitor “removed” that line about the JRE version, he didn’t leave anything in its place. Now webstart has no idea what JRE it needs and so it won’t run.

Ehhh. I just thught that if it needs Java 1.5 to run, it probably shouldn’t say 1.4+. Maybe 1.5+? I haven’t really bothered to learn webstart all that much. I just copy paste and change whatever seems resonable, and I thought this would be resonable to change. I could be wrong. Remove seems very wrong anyway.

I was just guessing since this machine only has 1.4 installed and webstart kicked off the game anyway… well attempted to.

NullPointer: Did you do the getResourceAsStream as Cas suggested? Could otherwise create just that I think.

Zip-file version worked fine on other machine with Java 1.5

about the NullPointerException, don’t forget that Webstart can sometimes trip over this:


getClass().getResource(...);

instead, use:


getClass().getClassLoader().getResource(...);

Wow, thanks for all the advice…

getClassLoader() has been added
Re-inserted the proper line into the JNLP file.

Clear the file from your cache and try again!

Thanks again!