I can’t get passed Chapter 5 How to Detect the Collisions
http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Chapter\_5\_~~\_How\_to\_Detect\_the\_CollisionsThe method " void HelloWorld::update " doesnt compile in version 2.0.4
I found out that I had to replace ccTime with float, but the rest of the code doesn’t work and I cant seem to find an answer.
The main problem with this method is dat it uses CCMutableArrayIterator.
I’ve rewritten the method with some tips I found on the internet. The game compiles, but the collision doesnt work.
This is what I’ve came up with:
CCArray projectilesToDelete = new CCArray;
CCSprite* projectile = ;
CCRect projectileRect = CCRectMake.x
CCArray targetsToDelete = new CCArray;
CCSprite target = ;
CCRect targetRect = CCRectMake.x~~ (target~~>getContentSize.width/2),
target~~>getPosition().y - (target~~>getContentSize.height/2),
CCSprite* target = (CCSprite*)(arrayItem);
CCSprite\ projectile = ;