GravityTrap ... first game

After months of lurking on this site I finally got off my butt and wrote a game…well, actually I kept my butt seated long enough to write it, but who cares about technicalities. Here’s the game:

http://www.xmeta.com/games/GravityTrap.jar

It’s a full screen pure Java 1.4.x game that is a bit like Asteroids ( :stuck_out_tongue: yeah, I know, not another one), but as the name implies gravity plays a central roll.

Controls are as follows:

  • left and right arrows turn the ship
  • up arrow moves the ship forward
  • space or control can be used to fire

There is no startup screen, no help, nothing but game at this point. If I can get my ISP to configure their server for the JNLP mime types, I will try to get it working with Java Web Start, but for now you’ll have to use the jar file (main class is GravityTrap).

That’s it! Let me know what you think!

Nicely done. No frame stutter at all. Here’s a great example of a game with interesting gameplay but extremely simple graphics…but I’d say this is quite a top notch game in the sense that it’s small (11k!) and it is quite enjoyable to play.

The only critical thing missing here is the sound. It’s not really a game unless there’s sound :slight_smile: (I’m so narrow minded.)

-Chris

Thanks Chris, I’ll get to work on the audio right away. I left it out initially so I wouldn’t wake the baby :).

Rick

Awesome! I’m working on a similar game, but I couldn’t get the gravity right. Mind if I borrow some of your code? ;D

Also, there seems to be some wierdness with the input, like key commands are getting buffered. I’d move the ship around and fire for a while, then my input blocks while a bunch of old commands execute. I’ll look at the source and see what’s causing it.

Hehe, is your last name pronounced “Gamer”??

That’s a really cool game! Nice physics. And still smooth even when there’s a slew of bullets on the screen. Very cool.

Tom

Thanks for the comments! I will probably open source this after the holidays, since I need to do a little refactoring on it and add comments to make it more readable.

[quote]Hehe, is your last name pronounced “Gamer”??
[/quote]
Actually it is pronounced “Guy-mer,” but maybe I’ll change it ;D

Open sourcing it would be cool if you get the time… I’d certainly like to read through the physics code…

See ya,

Tom

[quote]Also, there seems to be some wierdness with the input, like key commands are getting buffered. I’d move the ship around and fire for a while, then my input blocks while a bunch of old commands execute. I’ll look at the source and see what’s causing it.
[/quote]
Is this a comment about my game or yours? I can’t reproduce this in mine.

Yours. It’s real sporadic, but occasionally it happens. I’m not to hot with the gui stuff, but is it possible the commands are getting buffered?

Ok, I cleaned up the physics a bit…the spaceship now recoils properly when hit, and objects that merge or collide while travelling at similar speeds don’t suddenly go double speed.

I also got rid of some temp object creation during the render loop, so hopefully it will run even smoother now. Let me know if you still get the input buffering that you mentioned. I still can’t replicate it though.

http://www.xmeta.com/games/GravityTrap.jar

Rick

Oh, and does anybody know a good place to download free sound effects that I could add to my game. My brother the musician is trying to come up with something permanent, but I would like to come up with some adequite placeholders for now to satisfy cknoll :).

Ah, you’ll go far with such a joyous mentality of willing to please critics :slight_smile: Just whip out a microphone and make litle ‘bang’ sounds (no really, the word ‘bang’) and ‘ouch’ when you get hit and the sound you make when you hack up flem for thrust…that’ll get you started.

-Chris

Free sounds should be available anywhere in the net.
But thats no helpful hint, so:
www.flashkit.com has tons of free fx, loops, etc.

Laters

mbw ;D

Sorry to be the bearer of bad news, but my linux box that command buffering thing happens all the time. There seems to be a lag of perhaps 2-3 seconds before changes in the key state register with the game. The game runs really smoothly, it just doesn’t register keypresses in any useful way.

So, apart from being unplayable, it’s quite cool! ;D

Well, being home sick yesterday was no fun, but it did give me a chance to update my game. I fixed a few bugs, added some “acappella” sound :wink: and made the spaceship recoil when it shoots. Of course there are some drawbacks…adding audio doubled the size of the program…GravityTrap is now a whopping 22k!

http://www.xmeta.com/games/GravityTrap.jar

Not sure if this version will fix the problems people where having on Linux. I believe full screen Java never worked properly on that platform anyway.

Any comments will be appreciated.

I made some changes over the weekend that may help the people on Linux who reported that events were being queued up, but unfortunatly my Linux system is down right now, so if anyone has time to test it out I would appreciate it.

http://www.xmeta.com/games/GravityTrap.jar

Ok, in a last ditch effort to get some feedback on the updated version, I went ahead and made it Java Web Startable.

http://www.xmeta.com/games/GravityTrap.jnlp