can anyone help? ]]>

What’s happening is this, suppose dx = 5.

If I were to declare x = -dx, that would mean x = -5.

Now if I declare x = -x, it’s like saying x equals negative negative 5 (x = – -5) which reverses the negative to a positive. So now x = 5. If I do x = -x again, then it’s back to negative 5, if I do it again then it’s positive 5.

So when the ball hits the wall dx reverses it self from positive to negative, or negative to positive, and it’s all accomplished by dx=-dx. For either it’s a true negative -dx or a positive -(-dx).

]]>Thanks

]]>if( y280) dy=-dy;

x+=dx;

y+=dy;

sorry meant this one

]]>if( x280) dx=-dx;

if( y280) dy=-dy;

x+=dx;

y+=dy;