views:

227

answers:

3

I'm attempting to build a Lunar Lander style game on the iPhone. I've got Cocos2D and I'm going to use Box2D. I'm wondering what the best way is to build the floor for the game. I need to be able to create both the visual aspect of the floor and the data for the physics engine.

Oh, did I mention I'm terrible at graphics editing?

+3  A: 

I don't have a good answer for your question, but you may want to also ask over at the new iPhone game specific StackOverflow variant:

iPhoneGameDev.stackexchange.com

Kendall Helmstetter Gelner
If you don't have a good answer, why answer? It's called "Add Comment".
Jed Smith
I'm tempted to upvote this because i didn't know stack exchange was actually online and working....
RCIX
+1. This is a perfectly fine answer.
Alex Reynolds
A: 

I haven't used Box2D before (but I have used other 2D physics engines), so I can give you a general answer but not a Box2D-specific answer. You can easily just use a single static (stationary) Box if you want a flat plane as the floor. If you want a more complicated lunar surface (lots of craters, the sea of tranquility, whatever), you can construct it by creating a variety of different physics objects - boxes will almost always do the trick. You just want to make sure that all your boxes are static. If you do that, they won't move at all (which you don't want, of course) and they can overlap without and problems (to simulate a single surface).

Making an image to match your collision data is also easy. Effectively what you need to do is just draw a single image that more or less matches where you placed boxes. Leave any spots that don't have boxes transparent in your image. Then draw it at the bottom of the screen. No problem.

Eli
A: 

The method I ended up going with (you can see from my other questions) is to dynamically create the floor at runtime and then draw it to the screen.

jasonh