Add more particles, remove black color

This commit is contained in:
Robin Ward 2016-09-19 16:32:51 -04:00
parent 899779b3c4
commit 844c86481e

View file

@ -1,10 +1,10 @@
const MAX_PARTICLES = 100; const MAX_PARTICLES = 150;
const SIZE = 144; const SIZE = 144;
let width, height; let width, height;
const COLORS = ['red', 'black', 'blue', 'purple', 'brown', 'green']; const COLORS = ['red', 'blue', 'purple', 'brown', 'green'];
class Particle { class Particle {
constructor() { constructor() {
@ -17,7 +17,7 @@ class Particle {
this.origX = Math.random() * (width + SIZE); this.origX = Math.random() * (width + SIZE);
this.speed = 1 + Math.random(); this.speed = 1 + Math.random();
this.ang = Math.random() * 2 * Math.PI; this.ang = Math.random() * 2 * Math.PI;
this.scale = (Math.random() * 0.5); this.scale = (Math.random() * 0.4) + 0.1;
this.radius = (Math.random() * 25) + 25; this.radius = (Math.random() * 25) + 25;
this.color = COLORS[Math.floor(Math.random() * COLORS.length)]; this.color = COLORS[Math.floor(Math.random() * COLORS.length)];
} }