From 47e8b4b1aef02c65baa555eefd2e3308ee1c9440 Mon Sep 17 00:00:00 2001 From: zenoamaro Date: Sun, 30 Jun 2019 02:27:49 +0200 Subject: [PATCH] Draw terrain over traces --- main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.js b/main.js index c091014..ebec457 100644 --- a/main.js +++ b/main.js @@ -24,11 +24,11 @@ let trajectories = []; // Init layers const sky = createSky(W, H); -const terrain = createTerrain(W, H); const traces = createCanvas(W, H); +const terrain = createTerrain(W, H); const foreground = createCanvas(W, H); -for (let c of [sky, terrain, traces, foreground]) { +for (let c of [sky, traces, terrain, foreground]) { c.canvas.style.width = `${W * Z}px`; c.canvas.style.height = `${H * Z}px`; document.body.appendChild(c.canvas); @@ -346,7 +346,7 @@ function drawPlayers() { function drawTrajectories() { traces.clearRect(0, 0, W, H); for (let {x, y, c, a} of trajectories) { - traces.globalAlpha = a/255; + traces.globalAlpha = a / 255; plot(traces, x, y, c); } traces.globalAlpha = 1;