I am creating a ball by SKShapeNode
and CGPathAddArc
.
The thing is if I use a larger radius the ball moves slower.
If I use a lower radius the ball moves faster.
// width depends on screen size (iphone, ipad)
// on iPhone the speed of the ball is something I like
// when on the ipad the speed is very slow
CGPathAddArc(ballPath, NULL, 0, 0, self.frame.size.width/80, 0, M_PI*2, YES);
How do I make it(movement speed) constant whatever the radius is?
_ball.physicsBody = [SKPhysicsBody bodyWithPolygonFromPath:ballPath];
_ball.physicsBody.friction = 0.f;
_ball.physicsBody.restitution = 1.002f;
_ball.physicsBody.linearDamping = 0.f;
_ball.physicsBody.affectedByGravity = NO;
_ball.physicsBody.allowsRotation = NO;