I try to make the ball with realistic physics when it fall from cliff, as you can see in in image 2. that's what I what to achieve, for now I have what is drawn in image 1.
for image 1. I use this code:
ball.center.x += 5
ball.center.y -= 4
You will need a logarithm function to generate values for x and y You can check more here: theory
After importing UIKIT or FOUNDATION it will be like this in Swift:
func log2(x: Double) -> Double func log2f(x: Float) -> Float