I am making a game which the goal is when the user clicks the button, a ball (which is the imageSprite, not the preloaded ball) will move up, generally naturally, and back down with the looks of a gravitational pull. how would i be able to do that without it being glitchy? also ball cannot touch the edges of the canvas or game over.
the only thing I can find is pointInDirection, but it would point the ball and not move it. i think rotate and speed would have to be involved? can i get help on how to implement this
also, how would i be able to toggle a countdown when the start button is pressed, in relation to the ball moving? gravity would have to be implemented first, obviously, but the if-then would be complex ?
In that case, would I delete the variable ballSpeed altogether, or would I need a separate speed variable as well? sorry, I'm new to this I'm just trying to understand the best I can