我发现问题很接近,但没有任何帮助,任何人都可以看到我为什么要纠正这个错误吗?它有一个问题“(移动)”代码的第6行。感谢
// move the spirit left/right/up/down
-(BOOL)moveSpiritWidthOrientation:(GameSpirit*)spirit moveEnum:(GameMoveEnum)move setTransform:(BOOL)trans{
CGPoint gridPoint = [self getGridPointWithPoint:spirit.endPoint];
CGAffineTransform transform = CGAffineTransformIdentity;
switch (move) {
case GameMoveTopEnum:
gridPoint.y -= 1;
transform = CGAffineTransformMakeRotation(-M_PI/2);
break;
case GameMoveBottomEnum:
gridPoint.y += 1;
transform = CGAffineTransformMakeRotation(M_PI/2);
break;
case GameMoveLeftEnum:
gridPoint.x -= 1;
transform = CGAffineTransformMakeScale(-1, 1);
break;
case GameMoveRightEnum:
gridPoint.x += 1;
break;
}
答案 0 :(得分:7)
使用default
。即使default: break;
也可以。