I need to detect long touch in the game the game I am trying to make.How can I do so?
Other problem I am facing is to limit simultaneous touches. i.e the sprite won’t jump if user touches more than two times immedeatly one after other.
Also is their a way by which I can add touch duration factor to the height of jump the sprite makes?
Thanks
how do you grab your touches? I always use the following methods:
And in these methods you may take total control over all touches. For example remember the time the touch started:
for an instance variable startTime, or to check if a touch belongs to a certain object:
This way you can easily implement your touch logic the way you like it…
A good way to do this is – I find – to define all the required variables within the object of the game, like…
ADDED TO SHOW CONCRETE EXAMPLE CODE FOR ccTouchBegan: