Randomly flip some of the bubbles

This commit is contained in:
Robin Ward 2016-09-19 16:41:06 -04:00
parent 844c86481e
commit c718826134
1 changed files with 2 additions and 1 deletions

View File

@ -20,6 +20,7 @@ class Particle {
this.scale = (Math.random() * 0.4) + 0.1;
this.radius = (Math.random() * 25) + 25;
this.color = COLORS[Math.floor(Math.random() * COLORS.length)];
this.flipped = (Math.random() > 0.5) ? 1 : -1;
}
move() {
@ -97,7 +98,7 @@ export default Ember.Component.extend({
c.save();
c.translate(p.x - SIZE, p.y - SIZE);
c.scale(p.scale, p.scale);
c.scale(p.scale * p.flipped, p.scale);
c.fillStyle = p.color;
c.strokeStyle = p.color;
c.globalAlpha = "1.0";