Commit e0b87a52 by doszhang

dos

parent 1e2ca90f
...@@ -111,12 +111,20 @@ function update() { ...@@ -111,12 +111,20 @@ function update() {
function paint() { function paint() {
ctx.globalCompositeOperation = 'source-over'; ctx.globalCompositeOperation = 'source-over';
ctx.fillStyle = "rgba(0,0,0,0.1)"; ctx.globalAlpha = 0.1;
ctx.fillRect(0, 0, w, h); // ctx.fillStyle = "rgba(0,0,0,0.1)";
ctx.globalCompositeOperation = 'lighter'; var img = new Image();
for (var i = 0; i < particles.length; i++) { img.src = '/Public/static/fireworkbg.jpg'
particles[i].draw(ctx); img.onload = function () {
ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
ctx.fillRect(0, 0, w, h);
ctx.globalCompositeOperation = 'lighter';
ctx.globalAlpha = 1;
for (var i = 0; i < particles.length; i++) {
particles[i].draw(ctx);
}
} }
} }
function createFirework() { function createFirework() {
......
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