在Xcode 4中獲取此錯誤。我正在閱讀一本使用0.99.5的書,我認爲我正在使用1.0.0框架for cocos2d。cocos2d語義問題
錯誤:語義問題:分配給來自不兼容的類型 'CGPoint'(又名 '結構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;
}