Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 


Submitted by Sara Kapli, posted on April 15, 2002




Image Description, by Sara Kapli



You are looking at a screenshot of a game project we just finished as a school project with team of two people. The game was made with pure Java (J2SE) utilizing Swing a little bit in the menus and to display some HTML in the help dialog. We didn't use any third-party libraries or extensions provided with JBuilder, which was the development environment we used. Using CVS for version control on a server accessible in the net gave us possibility to work independently so we could make parallel changes.

The game is a turn-based board game for 2 to 4 players playing with the same computer. The idea is to look for the treasure shown in the right column. For each turn the player is allowed to rotate the extra block and insert it into the labyrinth so that new extra block comes from the other side. Piece can be moved freely in the available path before and after the moving of the blocks. The game is finished when one of the player has collected the set amount of treasures which can be seen in the lower right corner.

Assuring that player has a route through the labyrinth was trickiest. Because game area is rather small, this was implemented with a pretty simple flood-fill algorithm although it's not most efficient way to search routes. Using Swing Timer for animating moving row or column of blocks was an easy choice but afterwards we found out that it has problems with the new J2SE SDK 1.4 - we developed the game using 1.3.x. The animation isn't smooth with the 1.4 so we may have to look a bit on that too if it can be fixed. Since this was a project for a school course, we were also required to make a design document beforehand as well as documenting the structure with class charts and so. Due to careful planning of the game logic it was easier to code the game itself.

Newer Java versions support also PNG images and it proved to be particularly handy to use alpha channeled PNG images, so adding soft edges and shadows was very easy. All in all Java was very good choice for making a game like this in the relatively short timeframe we had for the project.

Game is not available for downloading yet since we want to do some minor polishing and packaging for it although otherwise the game is ready. The game is also currently only in Finnish but we may consider doing a translated version in case you don't want to learn some Finnish. ;-)

We received a nice little statue with text "Java gurus" as a reward since our project was voted as the best one in the class. That felt good after we had just spent the last two nights working our asses off.

We two used about 120 hours in total to coding, not counting making graphics. I made the graphics and a bit over a half of the code (mostly the graphics handling and drawing). I have been making 2D and 3D graphics for some game and demo projects in the past but this is the first game project I have partly coded.

St Rana


[prev]
Image of the Day Gallery
www.flipcode.com

[next]

 
Message Center / Reader Comments: ( To Participate in the Discussion, Join the Community )
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
Sniper BoB

April 15, 2002, 03:58 PM

amen to that

 
abnormal

April 15, 2002, 04:02 PM

I think coding a game in 120 hours is top for most of us here!

 
abnormal

April 15, 2002, 04:04 PM

At least it doesn't get boring with you ..

 
Joao Victor

April 15, 2002, 04:14 PM

Sara, your game seems to be really fun! I love 2D games (i think they've got some kind of fun that 3D games don't), and the graphics you made are just *beautiful* Maybe you should think about doing it in DirectX?

Victor.

 
coda

April 15, 2002, 04:41 PM

Impressive. I approve.

 
Summoner

April 15, 2002, 04:44 PM

I love labyrinth :-)

This looks like a lot of fun to play!
I think its great to really finish a project, even if it's not "high sofisticated" with 3d and all that stuff...

Really like it, keep up the good work!

PS.: don't take MC BAXTON's post to heart... he might be jealous

 
hdmx

April 15, 2002, 04:57 PM

Waste of time IS a design issue especially in Java where this happens very seldom :). I did not use Graphics2D for some time and I don't remember all those things I did not like. One thing I remember is that one was required to cast getGraphics() into Graphics2D.
Also most of it is pretty high-level and then again one is required to work with byte arrays. I guess if you use it regularly you will not notice this anymore and as I said it is imho far better than Java3D.

hdmx

 
Rand666

April 15, 2002, 05:04 PM

OMG FIRST REPLY TO FIRST POST OMG YAY FUN SUPER

OMG FIRST REPLY TO FIRST POST OMG YAY FUN SUPER

OMG FIRST REPLY TO FIRST POST OMG YAY FUN SUPER

OMG FIRST REPLY TO FIRST POST OMG YAY FUN SUPER

OMG FIRST REPLY TO FIRST POST OMG YAY FUN SUPER

OMG FIRST REPLY TO FIRST POST OMG YAY FUN SUPER

I OWNZ YOU WHERE IS MY PRIZE BIZATCHES??

BTW DID I SAY THAT THIS IS GAY?

 
Rand666

April 15, 2002, 05:05 PM

OMG FIRST REPLY TO FIRST POST OMG YAY FUN SUPER

OMG FIRST REPLY TO FIRST POST OMG YAY FUN SUPER

OMG FIRST REPLY TO FIRST POST OMG YAY FUN SUPER

OMG FIRST REPLY TO FIRST POST OMG YAY FUN SUPER

OMG FIRST REPLY TO FIRST POST OMG YAY FUN SUPER

OMG FIRST REPLY TO FIRST POST OMG YAY FUN SUPER

I OWNZ YOU WHERE IS MY PRIZE BIZATCHES??

BTW DID I SAY THAT THIS IS GAY?

 
Joseki

April 15, 2002, 05:06 PM

That looks a great game (I'd like to play a demo).

I'm currently writing a dissy on Java's suitability as a games programming language, both 2D/3D, and I've come to the conclusion that it will be taking the place of C++ in the future.

Not only is developer productivity increased (as the number of excellent C++ programmers who can use all of C++'s features is far less than the number of average C++ programmers, who sometimes struggle with multiple inheritence, etc...), but for the executives, making one piece of software that is multiplatform means they get far more financial returns than a single platform game, in the same space of time. Also Java is now getting 3D functionality that supports clent sided hardware.

It's these 3 main reasons games -will- end up being written in Java.

 
St Rana

April 15, 2002, 05:13 PM

Most of graphics are made by modelling in 3D and rendered. Some are modified photographs. Must admit that I'm lazy, it's easier to get lights and shadows right that way :)

 
coda

April 15, 2002, 05:19 PM

multiple inheritence is the root of all evil.

 
Muttley

April 15, 2002, 05:20 PM

Perhaps MC Baxton might like to show us what game programming he has done on Image of the Day? I'm sure we are all very interested to see his creations :-)

 
St Rana

April 15, 2002, 05:26 PM

When player changes the form of the maze, the moving column or row of the blocks is animated. There is nothing else truly animated although pieces move too. Animating movement of the piece would've been really annoying after few minutes playing, trust me :)

 
St Rana

April 15, 2002, 05:30 PM

We made game as a hotseat game because we didn't want to waste time coding crappy AI :)

 
St Rana

April 15, 2002, 06:02 PM

Workload was splitted among two people as logic and looks (both making and coding). It was quite natural way to split it =)

 
St Rana

April 15, 2002, 06:03 PM

I didn't bother to use Grapchics2D, there are just many pictures. I know it's not that elegant way to do it, but after all pics are small and everything was easy to do also without G2D so there would've been no extra help out of it.

 
Kallen McInerney

April 15, 2002, 06:03 PM

Depends on how you use it....if you're using it just to specify interfaces it's pretty darn useful.

 
Rusty

April 15, 2002, 06:05 PM

I think that you're pretty limited...

no regards

 
Rusty

April 15, 2002, 06:07 PM

They say that hope is a mother of fools.

 
St Rana

April 15, 2002, 06:21 PM

I really can't see point in porting game made for portable platform to single-platform API, why to cut square out of circle ?-)

 
Cerberus!

April 15, 2002, 06:53 PM

Waste of time, as in, don't set it or use it in any way. It's useful, but it'll eat your rendering speed.

A Graphics to Graphics2D cast is a minor point, since it's not the same as a (say) float to int cast, just redefining the type of pointer.

"Also most of it is pretty high-level and then again one is required to work with byte arrays"

Apparenty this is due to a bit of a power struggle at Sun - between those who strive for high level foolproof stuff and those who want more low-level access. Theres always other ways of doing things at a more higher level if needed (albeit slower).

 
Obble

April 15, 2002, 07:23 PM

Speed, lots and lots of speed.

i think.

 
Unarmed

April 15, 2002, 07:32 PM

Well I wouldnt expect java to be used for serious game programming the next 10-20 years. The main reason is speed, a cutting edge game normally use every drop of power it can get from the processor and that will be java's real problem. It simply does not look good writing a game that doesnt perform better than something you could run on your four year old hardware if it was written in C(++).

Java currently aint as crossplatform as they would like you to belive. But damn I wish it would become the standard and fast enough because then I actually didnt have to think to do stuff ;)

 
icedog

April 15, 2002, 08:06 PM

Nerdy..

 
MC BAXTON

April 15, 2002, 08:29 PM

I felt hope in wombat's post. You comment should belong to him ;p

 
Buster

April 15, 2002, 10:23 PM

Well, OK, java doesn't BLOW. I just don't like it at all! Some people swear by it.

 
lycium

April 16, 2002, 12:44 AM

honestly, i think non-nerds have no place on flipcode :) that's right, yourself included.

it's possible to like computers and still be (somewhat) normal.

 
raiderr1

April 16, 2002, 01:02 AM

MC BAXTON, you're definitely the most insulting person I know on FlipCode. You're post today was made up completely of insults. Didn't your mother ever teach you how to be nice to others? Seriously though, I've never seen you post ANYTHING of any value to anybody. Only after people yell at you do you mention anything nice about the current IOTD of the day which you happen to be insulting. Maybe you should spend some time by yourself for a while considering these facts.

 
neper

April 16, 2002, 01:35 AM

Looks very nice.
I am also working on a school project in Java, but I had to say that this is better than ours. And it would be interesting to know in which school this is done. 2 x 120 hours of work is quite a lot for a school project, isn't it?
By the way, I am also finnish speaking, so is it possible to get the game somehow?

 
This thread contains 89 messages.
First Previous ( To view more messages, select a page: 0 1 2 ... out of 2) Next Last
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.