我正在创建一个由SKShapeNode和CGPathAddArc制作的球。
问题是,如果我使用更大的半径,球移动得更慢。
如果我用较低的半径,球移动得更快。
// 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)
在看到画布是多么容易之后,我最近开始使用画布。我的第一个项目只是在圆圈移动的时候在它的边界上保持一个圆圈。我又做了一些涉及圆圈运动的东西,现在...
我目前正在研究如何在两个圆圈相撞时将它们弹开。你可以在这里看到这个例子:
然而,我想使用更多真实世界的物理学。目前,当圆圈相互碰撞时,它们只是反转路径。
如下所示:
// Dont be confused, this is just the Distance Formula
// We compare the distance of the two circles centers to the sum of the radii o