Code like:IF X>maximum THEN X=maximum
IF X<minimum THEN X=minimumIs used way too often.
It takes up way too much space and looks terrible.
Some people have made functions to do this, but there is a simpler way!
Instead, you can use:
<variable>=MIN(MAX(<variable>, minimum), maximum)
It's not only short, but also pretty easy to understand!
Limits X and Y to the screen limits.
Use this instead of:
IF X<0 THEN X=0
IF X>399 THEN X=399
IF Y<0 THEN Y=0
IF Y>239 THEN Y=239I mean you should probably just have checks when you modify your variables