Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.