Commit f16b95a9 by October

dos

parent ff433304
......@@ -167,7 +167,6 @@ function Particle() {
this.x = xPoint - this.w / 2;
this.y = yPoint - this.h / 2;
this.childrens = [];
this.vx = (Math.random() - 0.5) * 10;
this.vy = (Math.random() - 0.5) * 10;
......@@ -180,7 +179,6 @@ function Particle() {
Particle.prototype = {
gravity: 0.05,
move: function () {
this.childrens.push({x:this.x,y:this.y} );
this.x += this.vx;
this.vy += this.gravity;
this.y += this.vy;
......@@ -194,7 +192,6 @@ Particle.prototype = {
return true;
},
draw: function (c) {
var step = 0.05;
c.save();
c.beginPath();
this.w = this.w >= 0 ? this.w : 0.09
......@@ -206,26 +203,5 @@ Particle.prototype = {
c.closePath();
c.fill();
c.restore();
var newChildrens = [];
var alpha = this.alpha;
alpha -= step;
//console.log(alpha );
while( this.childrens.length > 0 && alpha > 0 ){
alpha -= step;
var children = this.childrens.pop( this.childrens );
c.save();
c.beginPath();
c.translate(children.x + this.w / 2, children.y + this.h / 2);
c.arc(0, 0, this.w, 0, Math.PI * 2);
c.fillStyle = this.color;
c.globalAlpha = alpha;
c.closePath();
c.fill();
c.restore();
newChildrens.unshift( children );
}
this.childrens = newChildrens;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment