my sprite can move up and down but some probs are there.......
sprite is moving slowly , i want some speed in moving the sprite
sprite is not continue move but jumping .....
sprite can not touch upper and lower limit of the screen
here is code i tried......
-(void) accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration
{
[_runeman setPosition:ccp(_runeman.position.x , _runeman.position.y + acceleration.x * 10)];
}
annd in upload method....
CGSize winSize = [CCDirector sharedDirector].winSize;
float imageHeightHalved = [_runeman texture].contentSize.height * 0.25f;
float downLimit = imageHeightHalved + 12 ;
float upLimit = winSize.height - imageHeightHalved - 12 ;
pos = _runeman.position;
pos.y += vel.y;
if (pos.y > upLimit) {
pos.y = upLimit;
vel = CGPointZero;
}else if (pos.y < downLimit) {
pos.y = downLimit;
vel.y = downLimit;
}
_runeman.position = pos;
