使用不兼容类型int的表达式初始化“CGVector”aka('struct CGVector')

时间:2014-07-16 22:24:33

标签: ios objective-c

以下代码的最后三行会生成警告

  

使用表达式初始化'CGVector'aka('struct CGVector')   不兼容的类型int

该警告意味着什么,我应该怎么做才能解决它?

-(void)update:(CFTimeInterval)currentTime
{

    CGPoint playerPos = _player.position;

    for(SKNode *enemyNode in _enemies) {
        CGPoint enemyPos = enemyNode.position;

        /* Uniform speed: */
        CGVector diff = TCVectorMinus(playerPos, enemyPos);
        CGVector normalized = TCVectorUnit(diff);
        CGVector force = TCVectorMultiply(normalized, 4);

0 个答案:

没有答案