Then they are written to the screen and updated by increasing the stars X coords. When a star reaches the left of the screen, the star's X value is set to 319, which is in the right of the screen. This is repeated until any key is pressed. The stars are initialized with random X and Y coordinates.
Every star get their own unique Z value, ie.
The screen is updated by increasing each star's Z coord. Then the X, Y and Z coords are converted to X and Y coords that we can plot on the screen. The color of each pixel we plot is depending on the star's Z coord. The stars will change direction on pressing Enter. Press escape to quit.