Zweihänder - BulletHell SHMUP

I decided I’ll make a game while learning Java so I figure I post here about it.

DL(with source):
http://rel.phatcode.net/junk.php?id=139

No sound version:
http://www.rel.phatcode.net/Temp/[Java]ZweihanderNoSound.zip

I didn’t even use OpenGL just straight Java2D.

Notes:

BTW, Does this thing stutter on your setup? If it does, how about the no sound version? Does the no sound version still stutter?

Comments on code are welcome.

Thanks to:
Badlogic, sproingie and ra4king for patiently answering all my stupid Java questions on IRC.
Kevin Glass

That was really quite slick, not stuttering on my system. Very nicely done.
The only thing that felt a bit off was the keyboard input - for some reason it only ever responded to two keys pressed at a time. For example, I couldn’t shoot and fly diagonally at the same time.

I’m afraid I get a console error on launch, using the jarfile-

Exception in thread "main" java.lang.UnsupportedClassVersionError: net/phatcode/rel/Main : Unsupported major.minor version 51.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
	at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:249)
	at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:56)

I had to roll back the JRE to version 6, download the tinysound jar, fix the build paths and tweak some of the field parameterisations in Sonics.java and Spline.java before I could get it to run in Eclipse. Then I get the following console error-

Unsupported audio resource!
could not get audio input stream from input URL
Exception in thread "main" java.lang.NullPointerException
	at net.phatcode.rel.utils.Sonics.playMusic(Sonics.java:57)
	at net.phatcode.rel.Game.init(Game.java:114)
	at net.phatcode.rel.Game.run(Game.java:237)
	at net.phatcode.rel.Screen.playGame(Screen.java:74)
	at net.phatcode.rel.Main.main(Main.java:16)

I’m using a 2.4 GHz Intel Core 2 Duo Macbook, with a NVIDIA GeForce 320M 256 MB graphics card. It’s a shame, since I’ve been looking for some examples of high-performing java2D code in action.

Thanks!
Mostly a hardware problem (it’s how the keyboard keys are “wired”). The only way I know to fix it is to introduce gamepad/joystick support (which at the moment, I have no idea how to do w/o the help of a native lib)

Morgan Allen: I’m not sure how to fix that myself as I’ve tested the jarfile on 3 different computers with jre 7 ( a WinXP, a Win7 and an Ubuntu).
Thanks for testing anyways. I have no idea what those error means (java noob) ;*(

I’m on Java 1.6.0_31 and couldn’t open the project.
(IntelliJ was complaining that I need Java7?)

More likely than not. I made this engine with JDK (though I would have no idea what’s not supported with 6 as I’m pretty new in Java).

I’ve uploaded a no sound version for people reporting stutters.

http://www.rel.phatcode.net/Temp/[Java]ZweihanderNoSound.zip

Please tell me if the no sound version still stutter.

Thanks!

It’s compiled against Java 7 so everyone’s gonna need a Java 7 installation to play it.

Cas :slight_smile:

[quote=“relminator,post:4,topic:41300”]
It might be worthwhile setting your JRE compliance-version to 6 or even 5 in eclipse if you can get away with it, just to make sure it’ll run on machines without the latest version of java. (And if you’re going to include source in the download, please include the ancillary libraries.)