mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
Randomly flip some of the bubbles
This commit is contained in:
parent
844c86481e
commit
c718826134
1 changed files with 2 additions and 1 deletions
|
@ -20,6 +20,7 @@ class Particle {
|
||||||
this.scale = (Math.random() * 0.4) + 0.1;
|
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)];
|
||||||
|
this.flipped = (Math.random() > 0.5) ? 1 : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
move() {
|
move() {
|
||||||
|
@ -97,7 +98,7 @@ export default Ember.Component.extend({
|
||||||
|
|
||||||
c.save();
|
c.save();
|
||||||
c.translate(p.x - SIZE, p.y - SIZE);
|
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.fillStyle = p.color;
|
||||||
c.strokeStyle = p.color;
|
c.strokeStyle = p.color;
|
||||||
c.globalAlpha = "1.0";
|
c.globalAlpha = "1.0";
|
||||||
|
|
Loading…
Reference in a new issue