Typically, not in any way that has elements like: an external requirement specification about what the ball should do (or that there must be one), and tests that validate that the ball is moving correctly.
It's basically art. Art of all types has internal technical challenges: specific problems to solve which are even testable. E.g. how do I get this paint to dry slower to have more working time for the intended style; how do I get these two materials to adhere; what fingering can I use to play this passage fluidly; ...
My point in this thread is that some people might be motivated into programming if they stop thinking they have to solve some external problem, other than the vague requirement of making something beautiful or entertaining.