Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (567)
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  
  Zweihänder - BulletHell SHMUP  (Read 2153 times)
0 Members and 1 Guest are viewing this topic.
Offline relminator
« Posted 2013-03-21 13:18:20 »

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/%5bJava%5dZweihanderNoSound.zip

I didn't even use OpenGL just straight Java2D.

Notes:
Quote
Zweihänder

Relminator
http://rel.phatcode.net

Language - Java
Graphics Context - Java2D
Sound - TinySound by Finn Kuusisto
Platform - Anywhere there's a JVM
GFX - AAP, Rel and some GFX fillers I found on the net
Music - VGmusic

Source license - Free to use as long as credit is given.

* No in-gameplay heap allocation so GC should not kick-in midplay.
* Used a "recycling" system to manage all the entities so heap allocs are only done at startup
* Entity manager is batched to minimize ram-latency (behaviors and animators are still not batched)
* Not sure if tinysound allocates memory on play().
* One enemy type for now but making other enemies should not be too hard.
* Needs better GFX (excepting bullets)

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
Offline davidc

Senior Member


Medals: 5
Projects: 2



« Reply #1 - Posted 2013-03-21 13:45:03 »

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.
Offline Morgan Allen
« Reply #2 - Posted 2013-03-21 13:51:20 »

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

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
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-

1  
2  
3  
4  
5  
6  
7  
8  
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.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline relminator
« Reply #3 - Posted 2013-03-21 13:59:34 »

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.

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) ;*(

Offline SwampChicken
« Reply #4 - Posted 2013-03-21 14:11:09 »

I'm on Java 1.6.0_31 and couldn't open the project.
(IntelliJ was complaining that I need Java7?)
Offline relminator
« Reply #5 - Posted 2013-03-21 14:37:58 »

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).
Offline relminator
« Reply #6 - Posted 2013-03-22 05:24:10 »

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

http://www.rel.phatcode.net/Temp/%5bJava%5dZweihanderNoSound.zip

Please tell me if the no sound version still stutter.


Thanks!
Offline princec

JGO Kernel


Medals: 386
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #7 - Posted 2013-03-22 11:40:48 »

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

Cas Smiley

Offline Morgan Allen
« Reply #8 - Posted 2013-03-23 11:19:40 »

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) ;*(
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.)
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.

Pippogeek (38 views)
2014-09-24 16:13:29

Pippogeek (29 views)
2014-09-24 16:12:22

Pippogeek (18 views)
2014-09-24 16:12:06

Grunnt (42 views)
2014-09-23 14:38:19

radar3301 (24 views)
2014-09-21 23:33:17

BurntPizza (61 views)
2014-09-21 02:42:18

BurntPizza (31 views)
2014-09-21 01:30:30

moogie (36 views)
2014-09-21 00:26:15

UprightPath (49 views)
2014-09-20 20:14:06

BurntPizza (53 views)
2014-09-19 03:14:18
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!