Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm using ccTouchesBegan/ccTouchesEnded to move sprite from one point to another but I'm having problem, if i give two or more consecutive inputs one by one while sprite is moving(runAction is being performed). It first moves to last point i touched and then teleports itself to previous touched points one by one.

share|improve this question

2 Answers 2

It does it because you are running two actions at the same time. Before making the sprite take an action just make it stop current/all actions he's doing.

share|improve this answer
    
What's the difference between CCTouchBegan and CCTouchesBegan? –  2600th Mar 21 '12 at 11:47
    
I don't rwally know but I would say Touches tracks multitap? Look at the function methods and you will know. –  MLProgrammer-CiM Mar 21 '12 at 12:01
    
@Beast one only invokes when working with multi-touch, and one will invoke with both single touch an multi-touch. –  Ali.S Mar 21 '12 at 13:39
    
Can't get CCTouchBegan to work. –  2600th Mar 22 '12 at 5:38
up vote 1 down vote accepted

To detect mulitouch use ccTouchesBegan as described in tutorial at cocos2d-x site. To detect single-touch you can use ccTouchBegan as described here.

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.