I have this program where an "x" bounces around the screen. It will bounce around the screen properly for about a minute or so but then suddenly it will bounce off of the screen and it will come back and draw a million x'es around the screen. this is the code i am using:
This block of code is supposed to bounce the "x" to the top right of the screen( w is supposed to be the y coordinate and v is supposed to be the x coordinate). It will properly work at first but when it hits the bottom right corner of the screen it will then bounce to the top right and just keep on going off of the screen.
if(w == 2)
side = 'l';
if(v == 68)
side = 'b';
Any suggestions on why this would happen? If that was a little too vague for you just tell me cause i am never too good on details.
#< this is where it would bounce off of the screen
this is where it would hit