xxxxxxxxxx
24
// Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/17WoOqgXsRM
var stars = [];
var speed = 20;
function setup() {
createCanvas(600, 600);
for (var i = 0; i < 800; i++) {
stars[i] = new Star();
}
}
function draw() {
background(0);
translate(width / 2, height / 2);
for (var i = 0; i < stars.length; i++) {
stars[i].update();
stars[i].show();
}
}