The error is due to "z = 1" rather than "1" here: FOR z = 100 TO z = 1 STEP -1 the "z = 1" is evaluated before the loop starts, at which time z is zero. So "z = 1" is false, and therefore zero. Ok, now... the main problem with your program is that the Z axis passes through the top-left corner of the screen. If you want to achieve the Starfield effect, it needs to go right through the centre of the screen. But this is easy to do. Just shift p and q from the corner to the centre of the screen. Eventually you'll want the stars to grow larger as they get closer, but for now I'd just use a white PSET for each star. Create a small array of random star co-ordinates (allow X and Y to be negative or positive; but make sure Z is positive) and draw them all at once. Then decrease their Z co-ordinates and draw them again. Rather than LINE (0, 0)-(640, 350), 0, BF, I would suggest just painting each star black. But that's mainly a speed/consistency issue. Hopefully that's all pretty easy. See how you go. |