Hi...I was wondering which would be faster for detecting whether or not an object was in the correct domain. I am not looking for size since this is a game written in basic, I will sacrifice space (since my game is turning out really small, my graphics for the sprites only take about 50 k
) for speed.
Example 1:
X+(X=0)-(X=95->X
Y+(Y=0)-(Y=63->Y
or Example 2:
If X=0:1->X
If Y=0:1->Y
If X=95:94->X
If Y=63:62->X
or maybe a combo of both? Example 3:
If X=0 or X=95:X+(X=0)-(X=95->X
If Y=0 or X=63:Y+(Y=0)-(Y=63->Y
I am just trying to avoid the extra restoring when X or Y is not out of range. Also, I use a modified version of the first example of code for changing my X and Y when a correct key is pressed, so for more speed would I change to whichever of the 3 types of code is fastest? Thank You.