将'NSTimeInterval'(又名double)传递给不兼容类型'CGFloat'又称'float'的参数

时间:2014-08-08 22:36:04

标签: ios7 xcode5 sprite-kit

-(void)movePipes
{
    [_gameLayer enumerateChildNodesWithName:@"pole" usingBlock:^(SKNode *node, BOOL *stop) {
        SKSpriteNode *poleSprite = (SKSpriteNode *) node;
        if (poleSprite.position.x < -50) {
            [poleSprite removeFromParent];
        }
        else
        {
            CGPoint distanceToMove = CGPointMake(-PIPE_POINTS_PER_SEC, 0);
            CGPoint amtToMove = CGPointMultiplyScalar(distanceToMove, _dt);
            poleSprite.position = CGPointAdd(amtToMove, poleSprite.position);
        }
    }];

}

这会引发以下错误:

Passing 'NSTimeInterval' (aka double) to parameter of incompatible type'CGFloat' aka 'float'

0 个答案:

没有答案