我幾乎已經完成了我的多點觸控代碼,但是我仍然遇到了另一個問題。這是在cocos2d做BTW :)多點觸控..需要iOS 4.3或更高版本的幫助
玩家對左側的DPAD和右側的按鈕,它工作正常,如果我按住了dpads的按住跳躍鍵,讓他給跑正確和跳躍。
的問題是,一旦我擡起我的手指斷跳躍鍵的所有動作停止,所以我必須擡起並再次按下我的手指向下DPAD ...
這是我cctouchesended
代碼-(void) ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
////when the user has stopped touching the screen set the variables
////back to false to stop its movement////
//self.myTouch = nil;
for (UITouch *touch in touches)
{
if (moveRight == TRUE) {
[player stopAction:RunForward];
}
if (moveLeft == TRUE) {
[player stopAction:RunBackwards];
}
moveLeft = FALSE;
moveRight = FALSE;
// jump = FALSE;
}
}