I am playing around with Ray W's whack-a-mole tutorial (http://www.raywenderlich.com/2593/how-to-create-a-mole-whacking-game-with-cocos2d-part-2) to try to learn Cocos2d.
However when i decrease the time the moles stay up i get to a point where it does not respond anymore, meaning it seems like the touch-code is to slow. The mole stay up long enough for me to hit on the screen, as with the slower pop's, but it does not register the hit.
I am using the code below for the actual hit, copied from the tutorial:
-(BOOL) ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event {
CGPoint touchLocation = [self convertTouchToNodeSpace:touch];
for (CCSprite *mouse in mouses) {
if (mouse.userData == FALSE) continue;
if (CGRectContainsPoint(mouse.boundingBox, touchLocation)) {
....code
I have enabled borders around the bounding box so i can compare so i really hit the same box as when it register the hit.
Anyone nice that can share some ideas?
Cheers