View Full Version : [help] how to let the rectangle bounce back?

11-13-2011, 11:19 AM
how to let rectangle that moves around and bounce back when it hits the border of the window?

I'm stuck with the bounce back of the border.

11-14-2011, 01:32 AM
Another homework assignment?
Which part are you stuck with?
A) Detecting the border and thus deciding when to bounce back
B) Subtracting rather than adding to the current position?