只是想知道这是否是我使用自定义操纵杆控制精灵运动的最佳解决方案。
//Move Up
if (bDegree < 45 && btocLength > 50) {
[self unschedule:@selector(movePlayerRight)];
[self unschedule:@selector(movePlayerDown)];
[self unschedule:@selector(movePlayerLeft)];
[self schedule:@selector(movePlayerUp)];
[self schedule:@selector(isPlayerWalking:) interval:1.0f/11.0f];
}
当我使用这种调度方式时,我在 xcode 中的调试区域似乎变得疯狂。这有关系吗?想法?
调试区
2013-06-15 10:03:59.866 AnchorMovement-iOS[9866:907] CCScheduler#scheduleSelector. Selector already scheduled. Updating interval from: 0.0000 to 0.0000
2013-06-15 10:03:59.875 AnchorMovement-iOS[9866:907] Degree: 178.148285
2013-06-15 10:03:59.877 AnchorMovement-iOS[9866:907] CCScheduler#scheduleSelector. Selector already scheduled. Updating interval from: 0.0000 to 0.0000
2013-06-15 10:03:59.924 AnchorMovement-iOS[9866:907] Degree: 177.795670
2013-06-15 10:03:59.928 AnchorMovement-iOS[9866:907] CCScheduler#scheduleSelector. Selector already scheduled. Updating interval from: 0.0000 to 0.0000
2013-06-15 10:03:59.949 AnchorMovement-iOS[9866:907] CCScheduler#scheduleSelector. Selector already scheduled. Updating interval from: 0.0000 to 0.0000
2013-06-15 10:03:59.953 AnchorMovement-iOS[9866:907] CCScheduler#scheduleSelector. Selector already scheduled. Updating interval from: 0.0909 to 0.0909
2013-06-15 10:03:59.988 AnchorMovement-iOS[9866:907] Degree: 177.425034
2013-06-15 10:04:00.117 AnchorMovement-iOS[9866:907] CCScheduler#scheduleSelector. Selector already scheduled. Updating interval from: 0.0000 to 0.0000
2013-06-15 10:04:00.120 AnchorMovement-iOS[9866:907] CCScheduler#scheduleSelector. Selector already scheduled. Updating interval from: 0.0909 to 0.0909
2013-06-15 10:04:00.854 AnchorMovement-iOS[9866:907] Degree: 177.795670
2013-06-15 10:04:00.920 AnchorMovement-iOS[9866:907] Degree: 178.148285
2013-06-15 10:04:00.922 AnchorMovement-iOS[9866:907] CCScheduler#scheduleSelector. Selector already scheduled. Updating interval from: 0.0000 to 0.0000
2013-06-15 10:04:00.982 AnchorMovement-iOS[9866:907] Degree: 178.519455
2013-06-15 10:04:00.985 AnchorMovement-iOS[9866:907] CCScheduler#scheduleSelector. Selector already scheduled. Updating interval from: 0.0000 to 0.0000
2013-06-15 10:04:00.989 AnchorMovement-iOS[9866:907] CCScheduler#scheduleSelector. Selector already scheduled. Updating interval from: 0.0000 to 0.0000
2013-06-15 10:04:00.990 AnchorMovement-iOS[9866:907] CCScheduler#scheduleSelector. Selector already scheduled. Updating interval from: 0.0909 to 0.0909
2013-06-15 10:04:01.061 AnchorMovement-iOS[9866:907] Degree: 178.890228
2013-06-15 10:04:01.092 AnchorMovement-iOS[9866:907] Degree: 178.898911
2013-06-15 10:04:01.095 AnchorMovement-iOS[9866:907] CCScheduler#scheduleSelector. Selector already scheduled. Updating interval from: 0.0000 to 0.0000
2013-06-15 10:04:01.107 AnchorMovement-iOS[9866:907] Degree: 178.903717
2013-06-15 10:04:01.109 AnchorMovement-iOS[9866:907] CCScheduler#scheduleSelector. Selector already scheduled. Updating interval from: 0.0000 to 0.0000
2013-06-15 10:04:01.124 AnchorMovement-iOS[9866:907] Degree: 178.910522
2013-06-15 10:04:01.127 AnchorMovement-iOS[9866:907] CCScheduler#scheduleSelector. Selector already scheduled. Updating interval from: 0.0000 to 0.0000
2013-06-15 10:04:01.139 AnchorMovement-iOS[9866:907] Degree: 178.930817
2013-06-15 10:04:01.141 AnchorMovement-iOS[9866:907] CCScheduler#scheduleSelector. Selector already scheduled. Updating interval from: 0.0000 to 0.0000