Seapegasus Blog

All | Hacks | Java Mobility | Mac | Misc | NetBeans | NetBeans_de
« Previous day (Jan 7, 2007) | Main | Next day (Jan 8, 2007) »
20070108 Monday January 08, 2007

Bang! 3D!

James Gosling says:

"I've been having fun with a funky Java game: Bang! Howdy!. Yikes! I've also been having a lot of fun with JOGL. It's become pretty damn cool."

Hehe, cool indeed, that's the same stuff I occupied myself with during the winter holidays! Even Gosling likes the JOGL libraries. :) I myself am using the jMonkeyEngine (jME) which is based on Java OpenGL (JOGL), and which was used to create the free online game Bang!Howdy!. I gotta admit I never played it though, I only looked at the spiffy screenshots to determine whether that APIs were worth learning to create a game of my own. And yes, they are. :-)

If even I can set up a 3D landscape with (simple) physics it can't be that difficult. ;-) For me, this game is the biggest netbeans project I ever created: It uses open-source libraries, and I put my files into real packages, and I even *gasp* extended existing classes, all the bells and whistles.

Alright, it's only an empty landscape with a wandering and hopping cube on it, the game part of the game is still kinda missing, but hey, you gotta start small. Since I wanted to contribute something back, I filled in three missing pages in the jME user guide wiki describing how 3D transformations work. I might add some more items to the users guide as I move along. It's a wiki, so feel free to improve what I wrote if you can think of a more efficient solution. I also had a look at Packaging and Deploying Desktop Java Applications with NetBeans, but somebody already was kind enough to provide a very well-done set-up tutorial that tells you which libraries to add to set up jME for your netbeans project -- I went through it and added indentation to make it more legible. It also works in release 5.5 by the way.

One thing about jME is that it's very easy to go through the first 10 tutorials and set up what they call a SimplePhysicsGame. You get something up and running within a day. But at the same time they say, if you want to make a real game, you should set it up yourself and not use the very primitive SimplePhysicsGame class. But how?

My solution was to ctrl-click on SimplePhysicsGame (in the line that says public class myGame extends SimplePhysicsGame) to see how SimplePhysicsGame was implemented. I copied over the whole implementation into my file to see how it was done. Of course it turns out that SimplePhysicsGame itself extends BaseSimpleGame, so some functions are still hidden in yet another class. I went trough SimplePhysicsGame's sources and looked for every call to super.something() and replaced it by the actual code from BaseSimpleGame. That way I now have control over all parameters directly, and am no longer depending on hidden default values.

Now my project is an exact copy of SimplePhysicsGame, so I went back to the physics tutorials and used what I learned there to add collision detection and a terrain. Terrains can be created by a randomizer, but I preferred the variant where you provide a grayscale bitmap to define what should he a hill (white) and what a valley (black). It gives me more control over the landscape and I will know in advance where I can place houses or trees (I can still randomize which and how many houses and trees I'll add each time, and use various bitmaps to get a bit of variation in the game.)

As I find out more, I'll keep you updated about how my increeedible 3D game is faring. Or maybe some of you have tried jME themselves and have tips to share?

Posted by seapegasus ( Jan 08 2007, 08:16:39 PM CET ) Permalink Comments [2]


Offline Tutorials

Many have been asking for a NetBeans docs zip recently, and here it comes: Patrick has created the one zip file to rule them all!

Yup, 15 MB of NetBeans tutorials that you can browse and read offline. If you are looking for the file later, you will be able to find it in the Docs&Support section of netbeans.org under Additional References.

Unzip the contents into a folder and open the page index.html in your browser. You'll get the most popular tutorials for Basic Java Programming, Web Applications and Web Services, Java EE Applications, NetBeans Platform and Module Development, and Documentation for Add-On Packs. It also contains a section about GUI applications -- without the flash demos though. If you want the full version of the GUI tutorial including flash demos, then

Have fun!

Posted by seapegasus ( Jan 08 2007, 03:40:22 PM CET ) Permalink


Wii is For Whiimps

You know what's really cool? Playing Tilt Scream Pong. With the Apple Sudden Motion Sensor. Yeeeaaah. (Thanks to Talley for pointing out the link)

. Posted by seapegasus ( Jan 08 2007, 02:30:16 PM CET ) Permalink


Calendar

Content

Search

Links

RSS Feeds

Recent...