iphone - cocos2d semantic issue -
getting error in xcode 4. reading book uses 0.99.5 think , using 1.0.0 framework cocos2d.
error: semantic issue: assigning 'cgpoint' (aka 'struct cgpoint') incompatible type 'double'
on line
playervelocity = playervelocity.x * dec + acceleration.x * sens;
any ideas.
full code
float dec = 0.4f; //lower = quicker 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; }
playervelocity
vector, should assign value this:
playervelocity = ccp(playervelocity.x * dec + acceleration.x * sens, 0);
ccp
macro build vector 2 component specify. gave 0 y component, feel free change value need.
Comments
Post a Comment