Trying to detect doubletap in Android (Cocos2d Framework). What am I doing wrong?
In ccTouchesEnded i have :
public boolean ccTouchesEnded(MotionEvent event) {
touchTapCount++;
Lg("Tapcount : " + touchTapCount);
if (touchTapCount == 1) {
Lg("We're in the 1 thingie!");
CCDelayTime delayaction = CCDelayTime.action(0.2f);
CCCallFunc callSelectorAction = CCCallFunc.action(this, "dtreset");
CCSequence a = CCSequence.actions(delayaction,(CCFiniteTimeAction) callSelectorAction);
this.runAction(a);
} else {
if (touchTapCount ==2){
Lg("Oh yeah we got double tap!");
}
}
And I've got the resetter :
public void dtreset(Object Sender){
Lg("Resetted the TouchTapCount");
touchTapCount = 0;
}
My output indicates that the sequence is not runned at all.. So count just gets added, there is no reset after 200 ms... :(
event
. Catch it in touchesBegan. – YvesLeBorg