Computer Science Canada preventing a box from leaving the screen |
Author: | Solar_Projectile [ Sat Jan 07, 2006 3:40 pm ] | ||
Post subject: | preventing a box from leaving the screen | ||
my question is this: how do i modify the code so that the box doesn't go outside the size of the screen or distort? if anybody could help, id be very thankful. |
Author: | Solar_Projectile [ Sat Jan 07, 2006 3:54 pm ] | ||
Post subject: | |||
I think i may have found a solution on my own, but i dont know if this is the proper/best way to do it
|
Author: | Cervantes [ Sat Jan 07, 2006 4:32 pm ] |
Post subject: | |
Pretty much, though there's no need to keep two variables (start and end) when you could just have end depend on start. endx is always = startx + width, and endy is always = starty + height. width and height are constants. |