Code request: platform-game

Hi,

I started programming graphic-stuff in Java and want to write a 2d-platform game (like Bubble Bobble or Rodland) without scrolling (using GAGE).

Thank you very much,

Sascha

Hello,
I’m not entirely sure what you’re asking here since it seems like more of a statement than a question. But here’s a go at it anyway. The Map class doesn’t have to be scrolled. It will be perfectly happy sitting still (fast too!). Of course, if you have one large image, load it with ImageIO, then create a new Map with 1x1 cells with screenWidthxscreenHeight cell size and set the image as the background. This will automatically buy you a few GAGE optimizations. All the sprite stuff should be the same. You’ll have to do the physics yourself tho. :slight_smile:

Good luck!

Hmm yes, there is no question, sorry. I`m looking for some tips for the collision-detection between the sprites and the map (CollisionMap or not)?

Thank you,

Sascha

I guess that depends on what you’re trying to accomplish. I’ll assume for a moment that you’ve been lurking and are referring to the as of yet unreleased CollisionMap class. The answer is, yes, that is how I’d do it. Using a collision map will allow you to easily test if your character’s bounding box has touched the wall/floor. IF you want to do pixel perfect, then you’ll need a collision map for each sprite and you’ll have to test those against the primary collision map and (when a CollisionHandler is triggered) against each other. To be perfectly honest tho, pixel perfect is an overkill for true to original Bubble Bobble. Now if we were talking Mario Bros. 3 where they had sloping hills, that would be a different matter.

It is not necessary to be pixel perfect. The first “game” should be as simple as possible. Last time I wrote gfx-stuff was in 1995 using AMOS ;D.