Collision detection

Previous topic - Next topic

Gary

Now my first project is sitting with Apple waiting for approval I thought I would look as my next one.

I am going to do a maze type game and the way I wish to do it is to have the player in the centre of the screen at all times and have the maze scroll round them as the maze is much bigger than the iPhone screen.

The way I planned to do it was to have 2 sets of graphics, one of just 2 colours for the maze and player which would be easy to check for collisions and then a full colour version that will be the displayed graphics. The maze will be about 1500x1500 pixels and I was planning on showing the correct area by using negative co-ordinates for the draw position so I do a single draw command rather than displaying a load of blocks.

My question is though looking at the sprite collision commands they seem to need to check by specifying actual co-ordinates of the sprites in question. If I was to make the map 2 colours with the walls a solid colour and the maze a transparent colour would the collsion detection only come in when actual pixels touch or does it just look at sprite sizes and say they overlap?

Thanks
Gary

Kitty Hello

uh. Why aren't you tiling the game and use the array[] information to do the collision checks? Or is it something like "worms"?

Gary

It a bit like Rally X that I am trying to do and one thing I found when I did my last program was there seems to be a fair bit of overhead in drawing multiple bitmaps to create an image and using a larger one with the uneeded parts drawn off screen seemed to be faster.

I will give the tiling a go though, it does make sense and thinking about it would make certain other parts of the game a bit easier to control and code

Thanks
Gary