Hi guys,
I'm working on a Space Invaders testcase.
You know those barriers right? Where you can hide behind and shoot a hole through? That's what I want to achieve.
Is it possible to do a collisiondetection pixelwise? And make a series of pixels of that sprite transparent after collision?
I'm using Cocos2d by the way.
Cheers
I think I'll have to go with a custom MutableTexture2d for fast getting and setting of pixels:
http://www.cocos2d-iphone.org/forum/topic/2449
My idea is:
- First do a pixel perfect collision detection using the pixelAt function
- If there's a collision do a 'sprite merge' with one sprite being an impact-radius sprite and of course the barrier sprite using setPixelAt.
Hope that's going to work out (performance).
Any other thoughts on the subject are very welcome.
Cheers
I'm working on a Space Invaders testcase.
You know those barriers right? Where you can hide behind and shoot a hole through? That's what I want to achieve.
Is it possible to do a collisiondetection pixelwise? And make a series of pixels of that sprite transparent after collision?
I'm using Cocos2d by the way.
Cheers
I think I'll have to go with a custom MutableTexture2d for fast getting and setting of pixels:
http://www.cocos2d-iphone.org/forum/topic/2449
My idea is:
- First do a pixel perfect collision detection using the pixelAt function
- If there's a collision do a 'sprite merge' with one sprite being an impact-radius sprite and of course the barrier sprite using setPixelAt.
Hope that's going to work out (performance).
Any other thoughts on the subject are very welcome.
Cheers
Last edited by a moderator: