Skip to content
Browse files

Added delay to clearing the map

  • Loading branch information...
1 parent 1d2bfdd commit 8e33a36d23b4bf3a70cd346ccc825d93608ed5b5 @cham committed
Showing with 8 additions and 2 deletions.
  1. +8 −2 src/Emitter.js
View
10 src/Emitter.js
@@ -12,6 +12,7 @@ define([],function(){
return {
touchdevice: false,
+ clearSwitch: 2,
cW: 480,
cH: 280,
@@ -152,8 +153,13 @@ define([],function(){
this.setupCanvas();
}
- this.ctx.fillStyle = "rgb(0,0,0)";
- this.ctx.fillRect(0, 0, this.cW, this.cH);
+ this.clearSwitch--;
+ if(!this.clearSwitch){
+ this.ctx.fillStyle = "rgb(0,0,0)";
+ this.ctx.fillRect(0, 0, this.cW, this.cH);
+ this.clearSwitch = 2;
+ }
+
this.ctx.fillStyle = "rgb(255,255,255)";
for(i=(this.particleOffset*this.particleAttrs);i<this.particles.length;i+=this.particleAttrs){
this.ctx.fillRect(this.particles[i],this.particles[i+1],this.particleSize,this.particleSize);

0 comments on commit 8e33a36

Please sign in to comment.
Something went wrong with that request. Please try again.