我几乎已经完成了我的多点触控代码,但是我仍然遇到了另一个问题。这是在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;
}
}