Sharing my Oxygene for Java game :)

Hey all,
I thought I’d share about a game I have just made with Oxygene for Java for a Pascal programming competition here:
http://www.pascalgamedevelopment.com/content.php?329-2nd-PGD-Challenge-The-Journey

Here is a video:

You can find the thread about my game “Platformation” here:
http://www.pascalgamedevelopment.com/showthread.php?13314-2nd-PGD-Challenge-quot-Platformation-quot

you can find the latest binary version here:
http://dl.dropbox.com/u/1805932/platformation_binary_v4.zip

and a slightly earlier source here:
http://dl.dropbox.com/u/1805932/platformation_source_v2.zip

Enjoy! :slight_smile:

cheers,
Paul

Hey, that’s awesome!
I’l check out that earlier source and see how you leapfrogged from initial stumbling blocks just a couple of weeks back to a full-fledged scrolling platform game :o)

Thanks for the kind words! It helped that I had the basic 2d tile collision code worked out in Delphi over a year ago, but I did have to port it over and get it working under Oxygene :wink:

I do admit to my fair share of fighting with the compiler as I got use to Oxygene-isms LOL

One good example was that I got a few internal errors when compiling some code that didn’t show where the error was…that was really ‘fun’ working out haha

On the whole though, it was not too large a learning curve moving from Delphi to Oxygene…and to be honest I didn’t use much of the new language features in the compiler compared to Delphi. That sort of stuff will come later :slight_smile:

I found that using LWJGL + Slick-Util really helped make the game easier (graphics + sound parts of it)

I’m hoping to enjoy checking it out.

However a quick test has me floored

Trying to run the app (after getting it built by re-adding the references, which were bad-pathed by being outside the project directory), I’ve tried various things.

Final effort was this from the Release directory:

java -cp .;lwjgl.jar;lwjgl_util.jar;jinput.jar -Djava.library.path=…\lwjgl\native -jar platformation.jar

The added refs have copy local to move them into the app output directory.

what am I missing?

<later>

Oh duh! Missing a \windows, so:

java -cp .;lwjgl.jar;lwjgl_util.jar;jinput.jar -Djava.library.path=…\lwjgl\native\windows -jar platformation.jar

Now I get:

AL lib: FreeContext: (040A0C10) Deleting 128 Source(s)
Exception in thread “main” java.lang.NullPointerException
at paulfnicholls.game.platformation.GameApplication.LoadSounds(Unknown Source)
at paulfnicholls.game.platformation.GameApplication.InitGame(Unknown Source)
at paulfnicholls.game.platformation.GameApplication.Run(Unknown Source)
at paulfnicholls.game.platformation.GameApplication.main(Unknown Source)

Ideas? Or shall i start trying to debug it?

Hmm. Not sure how to debug it with all those command line arguments needed.

Adding them to the command line arguments setting in the project properties didn’t help and I’m back to the first problem in the IDE

<gives up>

I had trouble with the references myself - I tried having them in the project directory, but that didn’t work when I changed computers because it still seemed to use an absolute path!

So I stored the lwjgl + slick-util in the same place on both computers (yuck I know).
I hadn’t put the slick-util one into that earlier source I think, but you could use the one in the binary.

I had to manually put the dlls into the bin\release and bin\debug folders and do copy local with the jar files, but that is all I did to get it working from in the IDE.

It just worked for me and other people when they manually executed the platformation.jar file by double-clicking (or opening it with Java)…

Does this help?

Maybe you could email me your version of the project and I can look at it?
paulfnicholls AT gmail DOT com

I am off to bed now though (10:45pm here in Tasmania, Australia…)

Wish you better luck!
PS. I am still using the trial version if this makes a difference?

:slight_smile:

I will have to upload the latest version of the source to see if this helps too!!

Ok, well copying the natives into the debug directory allows debugging, so that’s good

That begs the question how to pass Java.exe command line parameters in when debugging, as that doesn’t seem to work for me at all

Cooper BUG?

However I still get a null pointer on the first call to AL10.alBufferData

I didn’t have any luck debugging into the java code if that is what you are trying to do…

try this link (contains complete project including bin\release) (10.1MB zip file):
http://dl.dropbox.com/u/1805932/platformation_for_blong.zip

anyway goodnight! :slight_smile:
PS. Thanks Marc, Carlo, et. al for the excellent Oxygene for Java (trial at least)!

Thanks Paul. That one runs great from the command-line without any of the command-line stuff.

Total failure from the IDE though… the app tries to launch and immediately fails with the issue of not finding the lwjwgl files…

<later>

Ok, silly me, I was debugging against the Release target in this latest archive, which doesn’t have the native files in. Switching targets allows me to launch the app successfully and debug, which is great in this case.

The previous null pointer exception must be something in the code.

The remaining issue is that in the original source base, where the app is linking to jar files in another directory (i.e. where LWJGL is installed), it is not possible to launch or debug the app from the IDE. For the app to launch, all required files seem to be needed in the output directory.

I gather Viktoria is on the case on this thread.

Viktoria, do you understand the problem as I’ve described it? I.e. if some required .jar files are not in output directory and would normally be located by passing -cp to java.exe, and also other files get located by passing -D to java.exe, then the IDE makes running/debugging the app impossible.

Viktoria will reply on the debugging issue, but this is really cool! nice work Paul.

Paul: this is majorly cool! best of luck in the competition!

Thanks Marc and Carlo! :slight_smile:
Glad you like it…thought you would be interested in what your users have been up to instead of just support questions! haha

definitely! it’s always great to see the end results of what you guys are doing. you should talk to Jim, maybe you guys can turn this into a nice case study? especially if you win

It’s a top result for such a short amount of time. Very nifty, great effort!