Java CTYR, Now in the browser…

I get it now.

I really, really get it now.

After figuring out the stuff in LWJGL to make it work in a browser and show a black rectangle, I finally figured out how get a Slick2D app to do the same thing.

And here it is.

So now, from exactly the same code base, I can generate both the stand alone runnable jar and the web browser app.

The deployment is different, but that’s fine.

I can do it.

Yay for me.


Somedays, the sight of the black rectangle is the most beautiful sight in the world!

Today, I accomplished something.

I took my do-nothing HellowLWJGLApplet and put it into a web page.

You can see it here.

It seriously does nothing. It is the boilerplate from a LWJGL tutorial for getting an applet set up.

But, when this simply feat has eluded me for so long, it is a mighty victory.



Adventures in Java

In the end, I don’t want much as a developer.

I want a canvas that I can draw images and text on.

I want the ability to play a sound, and the ability to set the volume of that sound.

I want to be able to respond to keyboard and mouse input.

And I want to be able to set a timer that periodically does something.

And that’s all I want to do.

Also, I’m impatient, and I don’t want to take the time to learn a new tool or API or method of deploying something.

However, at the same time, I want a decent tool for debugging, and a simply way of deploying.

Eclipse, I must say, is a decent tool for writing and debugging code.

Even though the various Java platforms resist anything being easy.

I have played with Slick2D, playn, LWJGL, and Android development.

Playn seems like too much of a black art for me to want to try to use it.  It had me downloading all sort of nonsense like maven and git and the gwt.

I didn’t mind the android SDK. I was able to get going with OpenGL on it.

The main issue for me was that it took a really long time for the emulator to start up, so android development work would take me quite a long time.

So, I like LWJGL and Slick2D.

And, because I have now taken the time to learn how to structure my Java projects into different packages, I can create my game in such a way where there is very little platform specific code separated from the game code and renderer.

Both the web platform and desktop platform can share a renderer, and the android gets its own renderer, but the underlying logic winds up the same.

Everything else is configuration.

So, a common library of useful classes is one package.

One package is the abstract game logic.

One package is a platform specific renderer.

One package is the overall wrapper for the platform.

(In the case of the Android, the renderer/platform shell can be the same package).

And I feel like I’m “architecting”.

But at the same time, I’ve gone back to basics.

Rather than write most of a usable game prototype, I made HelloLWJGL.

It works in eclipse.

I made HelloLWJGLApplet.

It also works in eclipse.

Next, make HelloLWJGL work as a runnable jar downloadable to Windows, Mac, and Linux.

Next, make HelloLWJGLApplet work in a web page that I upload to my Dropbox account.


So I’ve learned the language.

I’ve learned the tool.

I’ve learned the platform.

Now it is time to do some damage.