thats going to take some time to perfect but think about then
if the potato hits the side of the paddle it would just bounce in a side-ways direction and get stuck bouncing back and forth forever
but i could switch it so the yvelocity is flipped but that would'nt be pysicly correct so i dont think there's a work arround this
let me know if u have a way to do this so its pysicly correct
At the moment, when the potato has just moved directly above the "catcher" you reverse its vertical ("y") velocity.
I suggest instead performing a check just
before the potato moves to see if it's going to go
into the catcher, and if so,
then reverse its vertical velocity. You can then (if you wish) have it also check to see if it's above the catcher, and if not, that means it struck right on the corner and you should reverse its horizontal ("x") velocity as well.
To prevent skilled players from exploiting this (by bouncing the potato into a screen corner over and over forever), you'd maybe make it random as to whether the catcher-corner rebound works or not (eg, check if math.random(2)==1 or some such thing).
will add that
That looks a bit better. Note though that "math.random(2,10)", for eg, should always return a number from 2 to 10: the "math.max" stuff wrapped around it isn't needed.
that sounds pretty confusing but if i added this wouldn't it be more idenical nirto's breakout game?
I've not played his particular version, but yes, it's a feature of most pong/paddlewars/breakout games.