A-HA! I found the reason B+! Those 2 lines just detect to see if any star goes past 600, either vertically or horizontally. It's just a trick to see how far the farthest stars have gone in that 1 direction. And since all of the directions move the same speed and length, only 1 direction is needed. If any of them passed up 600, it would make another new star in make: Knowing this, I changed the 600 to 800 because I had changed the screen size to 800 x 800 when I made the program. And now the stars even look better!!! Here is a better version:
You're not quite right in your thinking there.
Here's a quick thought process for you to try: Take a square piece of page and lay it flat on any surface. Take another piece of paper the same size and hold it vertical at the edge of the first one. Now, will another sheet, the same size, fit from the far edges of both sides?
If you have your paper like so (pardon the rough ASCII art):
|
|
|______Would the same size paper fit to make that triangle there?
Easy answer: It wouldn't.
To fit, that sheet of paper would have to be SQR(left side ^ 2 + bottom side ^ 2)...
Or, simplified SQR(2) in this case, times as long as the other sides.
SQR (1 page size ^ 2 + 1 page size ^ 2)=
SQR (1 page size + 1 page size)= *After all, 1 ^ 2 is still 1...
SQR (2 page size)
And how does this apply to your math in particular?
The center of your screen is at 400,400, so it's 400 pixels from the top and 400 pixels from the left. On the perfect diagonal, the distance from (400,400) to (0,0) makes one of those triangles once again, just as I was pointing out with the paper example above, so it's SQR(2) * 400 pixels in length...
566 pixels from the center, in any direction, will place you off the edge of the screen.
If it's only 566 pixels to the edge, why did Stx use 600 as his limit??
Same reason most programmers do such things; he knew it was off the screen with a little mental math, and didn't need to be bothered to figure out the exact distance for things to work properly for his code. He just plugged in a simple value
"close enough", and then moved on and didn't worry about the fine details...
IF (r > 600 ^ 2) THEN GOSUB make:
The above line would work just as well if the value was IF (r > 566 ^ 2) THEN GOSUB make:
Making it 800 doesn't make the program any better. ;)