Ok… I think I understand what he is saying now.
On line 15, he is setting a random velocity for the coin. I just started and restarted the game a number of times and the most recent time I started it, I got an X velocity of 0 and a Y velocity of 0, so the coin just sat in the center of the screen and didn’t move at all.
When it is moving just horizontally, that means that the Y velocity was randomly selected as 0, so it just moves back and forth across the screen.
In theory, he could get an X velocity of 0 and it would only move up and down.
So, a few suggestions. I wouldn’t allow for a velocity of zero. If the random velocity was chosen between let’s say 1 and 16, you would never get a horizontal or a vertical velocity and you would never get what I just got where by chance both were zero and the coin didn’t move at all.
2nd … if he wants to make it less predictable after the player catches a coin, I would reset the random velocity picker right after the collision. Then, when the coin restarts, it wouldn’t continue in the same direction as it had gone before, but it would instead choose a different random trajectory.
I think this is what he is after and he has done a great job. Let us know if there is something else we can help with or if he gets this and that isn’t quite what he was after.