Question

I'd like to create a game that has levels such as this: http://img169.imageshack.us/img169/7294/picdq.png

The Player moves "flies" through the level and mustn't collide with the walls. How can I create such levels?

I found that piece of software: http://www.sapusmedia.com/levelsvg/

It's not that cheap, so I wonder whether there is another way to create such a level as shown in the picture above...?

Was it helpful?

Solution

You can do that pretty easy by reading the color value of pixels at specific places of the level. Take for instance that your level background is white and the walls are black. In order to perform collision detection, whether your character had hit the wall, you would do the following: -take your character's position -look at the color values of the pixels of your map that overlap with character's bounding box or sphere at that position -if any of those contain black color you have yourself a collision :)

Now if your level is all colourful, you would want to build a black and white mask texture that would reflect the wall surfaces of your actual map. Then use the coloured map for drawing and the bw map for collision detection.

OTHER TIPS

I'd spend a good solid couple weeks getting caught up on Objective-C, Xcode, Interface Builder, and Apple iOS documentation. There are many good tutorials out there and sample Xcode projects to download and run on the iPhone/iPad simulator.

If just starting out, some of those quick startup libraries can rob you of the intimate knowledge you'll need to create the intricacies and nuances you'll need when your application starts to reach outside the boundaries of the code sandbox. Not bad to use as learning tools or to speed up development time, but I'd advise against using them as a crutch until you strengthen your developer legs. Crawl. Walk. Run!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top