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\$

2 Answers 2

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\$
4
  • \$\begingroup\$ What's the difference between CCTouchBegan and CCTouchesBegan? \$\endgroup\$
    – 2600th
    Commented Mar 21, 2012 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\$ Commented Mar 21, 2012 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
    Commented Mar 21, 2012 at 13:39
  • \$\begingroup\$ Can't get CCTouchBegan to work. \$\endgroup\$
    – 2600th
    Commented Mar 22, 2012 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\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .