multiplayer optomisation: make smoke trace solid on non-host side
This commit is contained in:
1 parent
9422b195f6
commit
995fcc1ef7
1 file changed
+7
-5
+7
-5
@@ -2410,11 +2410,13 @@ function drawPlayers() {
|
|||||||
|
|
||||||
function drawTrajectories() {
|
function drawTrajectories() {
|
||||||
traces.clearRect(0, 0, W, H);
|
traces.clearRect(0, 0, W, H);
|
||||||
for (let i=trajectories.length-1; i>=0; i--) {
|
for (let i=1; i<trajectories.length; i++) {
|
||||||
const trajectory = trajectories[i];
|
const prev = trajectories[i-1];
|
||||||
const {x, y, c} = trajectory;
|
const curr = trajectories[i];
|
||||||
traces.globalAlpha = trajectory.a / 255;
|
if (prev.c === curr.c) {
|
||||||
plot(traces, x, y, c);
|
traces.globalAlpha = curr.a / 255;
|
||||||
|
drawLine(traces, prev.x, prev.y, curr.x, curr.y, curr.c);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
traces.globalAlpha = 1;
|
traces.globalAlpha = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user