【发布时间】:2011-07-23 02:43:58
【问题描述】:
在 Xcode 4 中出现此错误。我正在阅读一本我认为使用 0.99.5 的书,并且我正在使用 cocos2d 的 1.0.0 框架。
错误:语义问题:从不兼容的类型“double”分配给“CGPoint”(又名“struct CGPoint”)
在这条线上
playerVelocity = playerVelocity.x * dec + acceleration.x * sens;
任何想法。
完整代码
float dec = 0.4f; //lower = quicker to change direction;
float sens = 6.0f; //higher more sensitive;
float maxVel = 100;
playerVelocity = playerVelocity.x * dec + acceleration.x * sens;
if(playerVelocity.x > maxVel)
{
}
else if(playerVelocity.x < - maxVel)
{
playerVelocity.x = - maxVel;
}
【问题讨论】:
标签: iphone cocos2d-iphone