From c718826134764b34e14ff4d3aff4820288ba63bb Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 19 Sep 2016 16:41:06 -0400 Subject: [PATCH] Randomly flip some of the bubbles --- app/assets/javascripts/wizard/components/wizard-canvas.js.es6 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/wizard/components/wizard-canvas.js.es6 b/app/assets/javascripts/wizard/components/wizard-canvas.js.es6 index 1f80e2ec4..9b0c2b2cb 100644 --- a/app/assets/javascripts/wizard/components/wizard-canvas.js.es6 +++ b/app/assets/javascripts/wizard/components/wizard-canvas.js.es6 @@ -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";