PuzzleFighter ~v0.4

I’m working on a java clone of the semi-popular arcade game puzzleFighter. It was ported to playstation and i’m pretty sure you can get it on the computer under maim, but i was bored, and it seemed like fun to start up.

Source here:http://joshman.ath.cx:81/pf.tar.gz. I’ve got it compiled there already, but if you want to compile it yourself, just javac PuzzleFighter.java.

To run: java PuzzleFighter .

This game is still really really rough. I’m posting for a dual reason, one to get feedback, and second i need help getting more out of java2D. I was considering going over to sdl, but i’d rather not have to. All the animation and gameplay is done in Game.java which is decently commented. If you’ve got any directions to point me, let me know.

A bit about the game:

It’s a tetris like game, but you battle. Drop same colored blocks into rectangles to get larger blocks, destroy blocks using the round “Crash Blocks” to send timed blocks to your opponents side. Right now i’ve got the keys rigged up so you can play vs yourself, using the arrow pad.

P.S forgive the horrible “XChain” animation, it’s what i was playing with when i found these forums, won’t be anywhere near that ugly.

edit: Here’s a screenshot:
http://joshman.ath.cx:81/pf3.png

What type of performance improvements are you looking for? The game seems to run fine on my puny laptop. If you mean that you want more in the way of a fast/smooth framerate, then Java2D has a lot more oomph to give you. To get it tho, you’d need to switch to active rendering via BufferStrategy. And you need to get rid of the multiple threads and synchronization. They’re slowing you down.

Here’s some stuff to help you out:

http://java.sun.com/docs/ - Look at the Java Tutorials on “Full Screen Exclusive Mode” in particular. You don’t have to be full screen to get many of the benefits, but it can help.

http://www.meatfighter.com - The first major Java2D full screen game. Lots of helpful stuff there.

http://java.dnsalias.com - A shameless self promotion, you can get yourself a hi-res timer plus some really cool code to study for getting the most out of the Java subsystems.

Let me know if you need any more help. :slight_smile:

[quote]To get it tho, you’d need to switch to active rendering via BufferStrategy. And you need to get rid of the multiple threads and synchronization.

Let me know if you need any more help. :) [/quote] This is exactly what i was looking for. I don't mind digging through API's and Google all night long, but it helps when you know what to look for, thanks alot. If you've got anything else for me to play with like BufferedStrategy, throw it my way. Thanks again.

No problem. If there’s something in specific you’re looking for, tell us. I’ll see what I can come up with. You should be able to find everything you need in GAGE (license free, BTW), but if you don’t, we’re here to help. :slight_smile:

Well, if you could point me at some simple code that implements a BufferedStrategy, i’d appreciate it. I’m just about to get started gutting out all the swing and paintComponent() stuff, so having a basic structure to try to match would be nice. I couldn’t locate the java tutorial(i was too excited to really dig :-/) so if you know exactly where it is a link would be great, otherwise you’ve done what i needed, pointed me in a direction, thanks again.

No problem. If you follow the link on the java documentation page marked “Java Tutorial”, you’ll see a link marked “Full Screen Exclusive Mode API”. That will take you here:

http://java.sun.com/docs/books/tutorial/extra/fullscreen/index.html

Have fun!

EDIT: Nothing to do with the OP, but this post just put me over the top to become a “Senior Member”. Better watch out Cas! :wink: