Star Field Code Star Field Code
Star Field Code

Under void setup I created a 1000 x 1000 canvas. I then created an array of stars with 2500 stars. When the stars go outside the window they will reset to their original location (line 7). I then made a black background. I used translate to make the stars move out from the centre of the canvas and move faster as they move outward. I then made the movement of the mouse across the x axis increase the speed from 0 to 50.

Katie Stewart

Source
Actions