1
\$\begingroup\$

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.

\$\endgroup\$
1
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ What's the difference between CCTouchBegan and CCTouchesBegan? \$\endgroup\$ – 2600th Mar 21 '12 at 11:47
  • \$\begingroup\$ I don't rwally know but I would say Touches tracks multitap? Look at the function methods and you will know. \$\endgroup\$ – MLProgrammer-CiM Mar 21 '12 at 12:01
  • \$\begingroup\$ @Beast one only invokes when working with multi-touch, and one will invoke with both single touch an multi-touch. \$\endgroup\$ – Ali1S232 Mar 21 '12 at 13:39
  • \$\begingroup\$ Can't get CCTouchBegan to work. \$\endgroup\$ – 2600th Mar 22 '12 at 5:38
1
\$\begingroup\$

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

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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