I use a 3px tall "collision range" in lieu of a single "collision pixel", meaning my only bug occurs when (~1 in every 3 balls, but random) they are able to and do run into the ball with the side of the paddle, and it "rolls" along. Your solution didn't work, but it was because a bit was left out on my part.
That is my current ball generation code:
Random ran = new Random();
deltaX = -deltaX;
deltaY = -deltaY;
x = (float) (ran.nextInt(300) + 25);
y = (float) (ran.nextInt(200) + 200);
And I need to make it so that it will necessarily touch
y = 60
This would be done by making it so that both are multiples of
. 60 is already a multiple (
). Now I need to make it so that the ball is a multiple.
Therefore, theoretically anyway, it should work to use
y = (float) ((ran.nextInt(50) + 50) * 4);
using your answer as a base.
However it does not.
Any ideas, now that you have all the information?
(also, I apologize for the delay; I was working on the NetIO class for MP, not to mention family vacation)