Gator4k

Thoughts?

http://java4k.com/index.php?action=games&method=view&gid=310

very nice !
However I find a little cruel to run over the alligators >:(
I’m always very impressed by those neat effects of the trail in the water … someday I’ll learn how to do it !

Nice water wake ripples, and funny concept. I like the way the alligators look at you and blink sometimes.

What about if there were some man-eaters which were a different colour that you have to shoot or else they eat your boat?

Ohhhh nice idea! I like it =P

Can’t try it

java.lang.ClassNotFoundException: G.class
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(ClassLoader.java:422)
at java.lang.ClassLoader.loadClass(ClassLoader.java:355)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Thread.java:717)
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:150)
at java.net.SocketInputStream.read(SocketInputStream.java:121)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:620)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:568)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1187)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:459)
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
… 7 more

Alas, super choppy on my Mac. We shouldn’t encourage people to use Left 4k Dead style active rendering because it no longer works on Mac…

Thats lame =/

Apo, If you could try again that would be awesome… I think it was because I had G.class instead of just G.
If it doesn’t work again, what’s your OS and browser?

Thanks for the input! This will be my only submission with active rendering anywho, I was hoping it would be smooth for everyone else since it runs smoothly on my crappy machine.

Very cool, love the water effect. Gameplay is fun, but wears thin after a level or two - would be nice if there we new mechanics introduced. I actually found myself swirling the boat around at top speed w/o any goal in mind just to watch the waves, which was quite fun, and was disappointed when the timer ran out on me :slight_smile:

[quote]Thanks for the input! This will be my only submission with active rendering anywho, I was hoping it would be smooth for everyone else since it runs smoothly on my crappy machine.
[/quote]
What exactly is “active rendering” and what is the alternative?

Runs smooth on my Linux Machine

What exactly is “active rendering” and what is the alternative?
[/quote]
I dunno who coined the term, haha. If you look at the game template in the templates section, it basically draws everything to one graphics context and then swaps that onto another one. Like double buffering sort of. Instead just drawing directly on the context. Doing the double buffering helps deal with tearing but for some reason the latest Mac OS X Java version vomits all over the place when you do it.

If you can spare the bytes, you could put a check for the OS version.

You basically create an empty image, then take the pixels as an integer array right from the image… and when you update the integer array it refreshes the image which is then drawn… thats what I did for the ripples. I assume thats the referenced technique… its used by a few games which want quick control over individual pixels.

I’m wondering if it’s because this Left 4k Dead method generates an array-backed int RGB image buffer, and the Mac OSX graphics is in a different form (perhaps floats?). However, I can’t imagine that drawImage can’t perform the translation in this “active” way. I’ll experiment with a few alternate flavors and post them up on the Mac posting to see if any of them work.

Now it runs smooth. Little fun game.

[quote]I’m wondering if it’s because this Left 4k Dead method generates an array-backed int RGB image buffer, and the Mac OSX graphics is in a different form (perhaps floats?). However, I can’t imagine that drawImage can’t perform the translation in this “active” way.
[/quote]
So, “active rendering” means to call image.setRGB() to generate each frame?

Active rendering means that you initiate the drawing:
You get a component, and request the Graphics object (comp.getGraphics()) and start drawing on it.

Passive rendering means that you wait for some external code to initiate the drawing:
Like when you call comp.repaint() and at some time later, the component’s paint(Graphics g) method is invoked.

Amazing water effects and good gameplay too. It’s nice how the alligators look at you, although this makes it even more heartbreaking to run over them.

I’d really like to know how to generate these watereffects myself.
It would push the graphics of any RPG to a new level,
especially the one I’m actually on :wink:
Is there a name for the effect or did you invent it yourself ?

Here’s the source code to this silly little game, It’s fairly commented if anyone cares =P

http://pastebin.com/bPuLTXiy