ccTouchesMoved() event can't keep up user's touches


#1

I tested a game incorporating ccTouchesMoved() event in the code and found out that the event isn’t called fast enough to keep up the changing touch-position from users.
My test is that I will move a sprite according to the current position of the touch from user.
Testing on cocos2d-x is fine, it can keep up but not for web. It seems I need to wait for user to stop the touching then sprite will change its position. I do think it’s a limit on browser to receive such intensive event.

Any idea on what might be the problem? Thanks ahead!


#2

Because the way browser handles touch/mouse event, a new event object is created when an event is triggered, unlike native cocos2d-x. this is a limitation in the browser side, so you need to assign the sprite position for every event.

what you saw was your touchended event firing and setting your sprite to that position only.

please have a look at touchtest in our test samples


#3

Thanks Hao Wu !