Skip to content

Commit

Permalink
[Add] Configurable maxParticleSize on effect 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Jayde-Im committed Jun 23, 2017
1 parent 7d03d98 commit b0b70b6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions code-blast.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ https://twitter.com/JoelBesada/status/670343885655293952
lastTime = 0,
particles = [],
particlePointer = 0,
maxParticleSize = 8,
maxParticleSize = 0,
MAX_PARTICLES = 500,
PARTICLE_NUM_RANGE = { min: 5, max: 10 },
PARTICLE_GRAVITY = 0.08,
Expand Down Expand Up @@ -64,13 +64,13 @@ https://twitter.com/JoelBesada/status/670343885655293952
color: color
};
if (effect === 1) {
p.size = random(2, 4);
p.size = random(2, maxParticleSize || 4);
p.vx = PARTICLE_VELOCITY_RANGE.x[0] + Math.random() *
(PARTICLE_VELOCITY_RANGE.x[1] - PARTICLE_VELOCITY_RANGE.x[0]);
p.vy = PARTICLE_VELOCITY_RANGE.y[0] + Math.random() *
(PARTICLE_VELOCITY_RANGE.y[1] - PARTICLE_VELOCITY_RANGE.y[0]);
} else if (effect === 2) {
p.size = random(2, maxParticleSize);
p.size = random(2, maxParticleSize || 8);
p.drag = 0.92;
p.vx = random(-3, 3);
p.vy = random(-3, 3);
Expand Down

0 comments on commit b0b70b6

Please sign in to comment.