Yay, doughnut space! I played with this kinda stuff as a kid back in the QBasic days.
Like Asteroids style.
Basically:
If X>10 then X=0
If Y>10 then Y=0
And then again
If X<0 then X=10
If Y<0 then Y=10
Like Asteroids style.
Basically:
If X>10 then X=0
If Y>10 then Y=0
And then again
If X<0 then X=10
If Y<0 then Y=10
while x > 10 do x -= 10
while x < 0 do x += 10
while y > 10 do y -= 10
while y < 0 do y += 10
What you have will discard some position information every time it wraps. Also, it won't correctly handle changes in position per frame that are larger than 10. x = x mod 10
y = y mod 10 x = ((x mod 10) + 10) mod 10I don't see that particular flow in the manual, and of course everything should be FULLCAPS.
https://en.wikibooks.org/wiki/QBasic/Full_Book_View#DO_.._LO...