Beta: Crystals

http://grexengine.com/sections/people/adam/crystals.html

Collect all the crystals within the timelimit to get the bonus, and advance to the next level.

Ideas for additional features welcome. Current planned features:

  • powerups (change size, shape, speed of player)
  • extra lives for high scores
  • different backgrounds (any ideas appreciated…)
  • enemies

Screenshot:

http://grexengine.com/sections/people/adam/crystals-screenshot.jpg

$ java -jar crystals-full-v1.2.jar 
net.tmachine.crystals.bBonusTimer: [DEBUG] Ticking clock URL = jar:file:/Users/sandymac/Desktop/crystals-full-v1.2.jar!/net/tmachine/crystals/sounds/clockticks.wav
Exception in thread "main" java.lang.NullPointerException
        at sun.applet.AppletAudioClip.<init>(AppletAudioClip.java:59)
        at java.applet.Applet.newAudioClip(Applet.java:263)
        at net.tmachine.crystals.bPlayerModel.<init>(bPlayerModel.java:31)
        at net.tmachine.crystals.bPlayerModel.<init>(bPlayerModel.java:38)
        at net.tmachine.crystals.Crystals.<init>(Crystals.java:27)
        at net.tmachine.crystals.Crystals.main(Crystals.java:19)

On Mac OS X with Java 1.4.1_01

Dude, if you needed a sound engine, you could have always swiped the one from GAGE. Using applet APIs was always a bad hack and was almost guaranteed not to work in the future. That’s what we have JavaSound for.

BTW, I get the same error as Leknor on Win2K.

Confirming bug on Win 2k

and I’ll just throw in a shameless plug for LWJGL:
http://java-game-lib.sourceforge.net/
which also has audio support, which outperforms GAGE [shadow=red,left,300]any day of the week[/shadow] :stuck_out_tongue: :stuck_out_tongue:

[quote]and I’ll just throw in a shameless plug for LWJGL:
http://java-game-lib.sourceforge.net/
which also has audio support, which outperforms GAGE any day of the week
[/quote]
He could use that. That is, if he wanted to reengineer the entire application around LWJGL plus worry about various native libs. LWJGL is a great hammer, but we do have a few nuts and bolts around here.

same null pointer here.

[quote] He could use that. That is, if he wanted to reengineer the entire application around LWJGL plus worry about various native libs. LWJGL is a great hammer, but we do have a few nuts and bolts around here.
[/quote]
hehe - two things:

  • GAGE has a native time too (yes it isn’t strictly needed)
  • You can use OpenAL without using the rest of LWJGL. - it’s only input/window that are tied together (for obvious reasons).

LOL! And you know what, I copied to a separate directory and tested before uploading!

Problem is very simple - Applet.getAudioClip dies gracelessly (and with the wrong exception!) when the file that the URL references cannot be found; bug. I was creating an AudioClip for a file that I was no longer using; the JAR file was a bit too large for comfort, so I pruned unused files, including a WAV - but the reference to create the AudioClip was still around in my initialisation.

Anyway, removing one line of code has fixed the problem :).

NOTE: I cannot upload the update for another ten minutes or so. Samba on linux has just destroyed my local filesystem (again - even for linux, it’s a horrifically buggy piece of **** :frowning: ), and I have to reboot :(. Since I cannot save ANYTHING to the hard disk before rebooting, I’m going to post this message. If you check the download page and it’s offering you version 1.21 or above, then the upload has gone through OK.

PS: I hope to switch to better sound API’s ASAP, but I need time to evaluate which one(s) to use; I only added sounds at the last minute on this release, just to see how well they’d work…thanks for pointing out the problem :).

[quote] If you check the download page and it’s offering you version 1.21 or above, then the upload has gone through OK.
[/quote]
Fixed version uploaded…and I have just re-tested it, so I’m sure it’s OK this time :).

pretty cool. some bugs though:

  • if you press and hold left mouse button you can move the pointer and the cross will stay. when you release the button the cross appears at the pointer -> space warp! a tad too easy to cheat don’t ya think? :slight_smile:

  • when starting, it’s possible to have the cross at a bomb and that’s annoying. so, place the pointer in the middle or somwhere there isn’t a bomb.

  • the starfield is moving a bit choppy. fullscreen perhaps?

one more:

  • it doesn’t terminate correctly. it leaves a java process running and eating 17 mb of memory.

Quite nice :slight_smile:
Lately there seem to be a lot of these extremely simple but addictive little games popping up here.

Some small remarks/suggestions:

  • I’d put the red translucent (which looks rather cool) ‘window’ to the center of the screen.
  • Sometimes the cross appears on top of a bomb.
  • It could get harder more quickly. Maybe by making the bombs move, or for example adding different kind of crystals that make all bombs instantly relocate to other positions.
  • The background stars could scroll more smoothly.
  • Maybe it’s an idea to make the background light up light blue when collecting a crystal (and fade to black again) or red when you hit a bomb to make it a bit more ‘flashy’.
  • Make it an applet

[quote]pretty cool. some bugs though:

  • if you press and hold left mouse button you can move the pointer and the cross will stay. when you release the button the cross appears at the pointer -> space warp! a tad too easy to cheat don’t ya think? :slight_smile:
    [/quote]
    What a cool idea! I’ll see if I can work it into a powerup (and disable that “feature” in normal play :wink: ).

Sure, thanks for pointing it out. The way it works at the moment is that the pointer is attached to the absolute mouse position, but that’s just too easy. The pointer-behaviour is a class hierarchy of its own, so I can swap in and out different behaviours - one I have in mind is a “slippery” or “skidding” cursor - it carries on moving a little when the mouse stops. [cackles evilly].

Hmm. My PCs only use graphics tablets (RSI problems :(), so I may end up making the cursor-control too difficult by accident. Will try and be careful :).

Oh, bugger. Probably just because the starfield was very quick-n-dirty, and only calls repaint() every 100 (!) milliseconds. I was afraid of being profligate with CPU, and “it’s only a background”. I’ll increase the framerate for the next version - let me know if you notice an improvement then ;).

super. it’s gonna be top-notch.

simple and addictive.

Version 1.22 now up.

Fixes:

  • exits correctly (I often forget to add the close-handling in Swing.Doh!)
  • message windows centred
  • the cross that you are controlling always shows up (it was inheriting the “last colour used by the starfield” which often meant dark grey, and sometimes meant almost black.

New features:

  • increasing difficulty. This just increases the number of mines; on low levels, the number of mines increases gradually, on high ones it increases very fast.

This is just a minor revision; I should be doing other work, but instead I’m adding some structures that will enable mobile mines and primitive AI.

[quote]Version 1.22 now up.
[/quote]
!“£$”!%£"!£%.

I’ve just noticed that when you die, the difficulty level isn’t reset. I got to difficulty 13, and now it’s rather hard to play :).

Version 1.23:

Fixes:

  • Difficulty now resets to 0 when you lose all your lives :slight_smile:

Features:

  • Extra life every 10,000 points
  • The amount in the Bonus timer increases on harder levels

Again, this is just another minor revision.

On this version, my personal best is 49,746 - SO CLOSE to getting that extra life :(.

So when’s the online scoreboard coming? :wink:

[quote]Quite nice :slight_smile:

  • It could get harder more quickly. Maybe by making the bombs move, or for example adding different kind of crystals that make all bombs instantly relocate to other positions.
    [/quote]
    Any feedback on the new “increasing difficulty” will be appreciated…:slight_smile:

…still working on adding moving enemies/mines/etc

Done; let me know what you think (just a simple impl at the moment). I think I’d prefer to do a fast-but-gradual fade - but 1.4.1 is VERY slow at drawing translucent colours to the screen - even fillRect is slow (slow enough that you don’t want to be doing it more than once or twice a second).

[quote]So when’s the online scoreboard coming? :wink:
[/quote]
As soon as the gameplay is relatively stable - enough that the average scores won’t wildly fluctuate from version to version! :).

…or else I guess I’d need one scoreboard per point-release of the game…

At least no-one’s asking for a multipayer version yet; but I have got one in mind. It’d be pretty mental - two players competing to grab the same gems before the level ends. Highest scoring player - once both players are dead, wins.

So, it can sometimes be worth not bothering to collect crystals, and let your opponent do it - in the hope that they’ll die soon, and you get to play alone from there. But of course, if they’re scoring all the points, they’re the one getting al the extra lives… :wink:

Seeing as my day job includes writing MMOG server technology, I’ll be really depressed if I can’t get a multiplayer version working pretty soon :).