views:

285

answers:

2

I need to create a Java-based platformer game for a high school project (not computer science related), and I want to spend as little time on technical stuff as possible.

I'm already experienced in Java, and I already have most of the gameplay, graphics, etc. All I need to do is code it. I've looked and I'm considering one of two options that do not involving coding a game from scratch:

  • Copy an existing Java platformer (best option, but I can't find an open source Java platformer)
  • Use a Java game engine to avoid coding from scratch. I've looked at JGame but I'm not sure if it's the best bet for a platformer.
+1  A: 

There's a book called "Killer Game Programming in Java" that has an example of a 2D platform game using the Java 2D Graphics API. I think the source code for the book is available on the author's site here: http://fivedots.coe.psu.ac.th/~ad/jg/

It's a decent book, but the code examples are a little messy. It might give you enough to get started though.

Andy White
I have that book... He explains things very well but he's not very good at coding.
Vuntic
A: 

Developing Games in Java is a great book, and the first half of it goes in detail about creating a 2D platformer game. Overall I found the book's explanation to be excellent, and the full game is on the CD so you could mod it to fit your needs. [edit: wait a second... it doesn't come with a CD... the source is on the website, see below!]

I don't feel like it's a super fully-developed platformer; it feels more like a demo. But you could use the game as a starting point and add anything else you need. And the code, being a book example project, is well documented and commented. It has a level format too, so if you find it fits all your needs you should be able to just drop in your images and make your own level files, and then load them in-game.

By the way, the rest of the book dives into creating a software 3D engine from scratch using Java 2D. It's really awesome. Just a bit of a bonus after this project is done, eh?

Also a downside, the book is now almost 7 years old. It uses Java 1.4 though, and the book website is still online, so I'd say it's still a viable resource! In fact, it looks like the book website has a demo of the game AND all of the source code, so you might not even need to buy the book. Go check it out!

Ricket