Too Simple? Boulderdash clone. (DASH)

Tonight I wrote a little game to demonstrate some stuff we’re working on in J2DA (http://sf.net/projects/j2da).

Its a very simple boulderdash clone I’ve just called Dash.

Webstart from here:

http://www.cokeandcode.com/j2da-dash/

it’d be nice to test that the webstart works on all platforms.

I was going to comment up the code and provide it as a sample for J2DA but I wondered if it might useful as a general purpose 2D example?

Apologises for the graphics (my own unartist efforts this evening). There is a little tool for building the levels which would maybe be a nice example of an engine vs data in game tech. I’ve only had time to put together a single test level at the moment.

Kev

works on Win2k

OK on linux/1.4.2.

it works fine on xp/1.4.1.
The close button of the window doesn’t work though. The only way to leave the game is pressing esc?

Works fine on Win98 with JDK 1.4.2. But again: Close button doesn’t work…

Tommy

works on win2k, 1.4.2, ie6

Works on Mac OS X 10.2.6 JRE 1.4.1

I noticed you can still dig with an invisible guy after you die… you can even complete the level as a ‘ghost’ :slight_smile:
It’s a good start… Needs some sound effects though.

Yep, I’ve not updated the webpage as yet, but I’ve fixed the above bug and added the extra levels.

Troggan has found me some better graphics also.

Sounds like their will be a tutorial around the game available, the source will be available as an example for J2DA.

Not sure about sound just yet. Wondering how that fits into J2DA. I guess it doesn’t. damn it!

Kev

c.f. this:
http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=announcements;action=display;num=1062820443;start=0#1

Howabout making it network multiplayer? Do it as simple as you like, using io and net - and I’ll convert it to NIO :)…so long as it’s client-server or > 2 players (little or no point in using NIO otherwise, and rather poor as an example I’m afraid :().

I’ve been wanting to look at 2+ player network platform game for a while now. Still stifled on time tho.

New dash demo, with funky graphics and a really annoying midi track in the background on webstart… now.

Kev

Great improvement! :smiley:
I think in the original boulder dash the crystals fall down too, and in the original you are able to out run falling things.

Your wish, is my command!

Updated webstart.

Kev

Hmm… do you do something like that:
mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
?

Because that takes my machine down if BufferStrategie is used. Java(w) doesnt run anymore but something eats tons of cpu cycles… bringing my machine to a crawling speed (1mhz alike - really).

Unfortunately I don’t know the reason… it could be my OS (win98se), gfx driver (deto 30.82), directx (9.0) or whatsoever :confused:

[I hadn’t submitted a bug report… simply because I don’t know were, how and I’m also afraid I would need yet another login (and I already have 5 of those _only_ for sun pages).]

Well… adding a WindowListener wich flags runRenderLoop (or so) to false works much better.


[...]
try
{
      Graphics2D g;
      BufferStrategy bufferStrategy;
      GraphicsConfiguration gc = device.getDefaultConfiguration();

      createBufferStrategy(2);
      bufferStrategy = getBufferStrategy();
      
      mainFrame.addWindowListener(this);
      
      [...]
      
      while(runRenderLoop)
      {
            g = (Graphics2D)bufferStrategy.getDrawGraphics();
            if (!bufferStrategy.contentsLost())
            {
                  [...]
                  bufferStrategy.show();
                  g.dispose();
            }
      }
}
catch (Exception e)
{
      System.out.println("[dirty]exit");
e.printStackTrace();
}
finally
{
System.out.println("[clean]exit");
}
[...]
//-----------------------------------------
public void windowActivated(WindowEvent e) {System.out.println("wActivated");}
public void windowClosed(WindowEvent e) {System.out.println("wClosed");}
public void windowClosing(WindowEvent e)
{
      System.out.println("wClosing");
      runRenderLoop=false;
}
public void windowDeactivated(WindowEvent e) {System.out.println("wDeactivated");}
public void windowDeiconified(WindowEvent e) {System.out.println("wDeiconified");}
public void windowIconified(WindowEvent e) {System.out.println("wIconified");}
public void windowOpened(WindowEvent e) {System.out.println("wOpened");}

Oh… the game itself is a nice demo :slight_smile:

ATM the window closing just System.exit(0); Does pressing ESC have the same effect on your machine? Interesting problem tho.

Kev

Esc works fine :slight_smile:

(luckily) :>

[quote]I’ve been wanting to look at 2+ player network platform game for a while now. Still stifled on time tho.

New dash demo, with funky graphics and a really annoying midi track in the background on webstart… now.

Kev
[/quote]
Ah, come on :)…it’d hardly take you any time at all! The only tricky part is deciding the gameplay/design part of multiplayer (and as this is a demo game, it probably doesn’t require much effort to think of something that’ll be OK?)

I see the need for a Network example, but at first we have to get finished with our j2da stuff. much work to do there. but you are free to help us, just check out the code from the cvs and add the network stuff :slight_smile:

troggan

[quote]I see the need for a Network example, but at first we have to get finished with our j2da stuff. much work to do there. but you are free to help us, just check out the code from the cvs and add the network stuff :slight_smile:

troggan
[/quote]
I want to show people how to convert from IO+NET to NIO…one of the difficulties is that it’s so long since I used the former (and they are so difficult to use) that it’s really difficult for me to produce a realistic example. So, I’m cruising around looking for real-life examples :).

I would have thought I’d have had quite a few people wanting a free conversion to NIO ;), but no response so far :(.

(and I can’t do CVS, I’m afriad. Too much pain, too many bad experiences - including running projects where the linux version of CVS trashed the odd file now and then - and also all the times I personally have just done completely the wrong thing and screwed it up :(. These days I can’t even manage to check files in to SF, or other properly-setup CVS stores without screwing up, so I stick to RCS or automatic stuff that other people have already setup locally)

Well… our teams CatAttack project was a fully working networked game (2 to 4 players, client-server method). It used just standard java sockets and a thread for each connection if i remember correctly.

If you want to take a look at it (all threads about it have been lost in the forum switch it seems) just drop me a message or an email. All the code and resources are still lying around here in a working state :slight_smile:

There’s a boulderdash like game in Java.net too
if you want to see it,
check it out :

http://bouldercat.dev.java.net