gas charge fix
This commit is contained in:
parent
bcbed3959c
commit
6d1b06f467
|
|
@ -98,13 +98,21 @@ function drawPixels(forceTick=false) {
|
||||||
ctx.arc((pixel.x+0.5)*pixelSize+(18*Math.sin((pixel.y+incrementt)/4.4)), (pixel.y+0.5)*pixelSize+(18*Math.sin((pixel.x+incrementt)/4.4)), pixelSize/2, 0, 2 * Math.PI, false);
|
ctx.arc((pixel.x+0.5)*pixelSize+(18*Math.sin((pixel.y+incrementt)/4.4)), (pixel.y+0.5)*pixelSize+(18*Math.sin((pixel.x+incrementt)/4.4)), pixelSize/2, 0, 2 * Math.PI, false);
|
||||||
ctx.fill();
|
ctx.fill();
|
||||||
}
|
}
|
||||||
if (pixel.charge && view !== 2) { // Yellow glow on charge
|
if (pixel.charge && view !== 2) { // Yellow glow on charge
|
||||||
if (!elements[pixel.element].colorOn) {
|
if (!elements[pixel.element].colorOn) {
|
||||||
ctx.fillStyle = "rgba(255,255,0,0.5)";
|
if ((view === null || view === 4) && elements[pixel.element].state === "gas") {
|
||||||
ctx.arc((pixel.x+0.5)*pixelSize+(18*Math.sin((pixel.y+incrementt)/4.4)), (pixel.y+0.5)*pixelSize+(18*Math.sin((pixel.x+incrementt)/4.4)), pixelSize/2, 0, 2 * Math.PI, false);
|
ctx.fillStyle = "rgba(255,255,0,0.5)";
|
||||||
ctx.fill();
|
ctx.beginPath();
|
||||||
}
|
ctx.arc((pixel.x+0.5)*pixelSize+(18*Math.sin((pixel.y+incrementt)/4.4)), (pixel.y+0.5)*pixelSize+(18*Math.sin((pixel.x+incrementt)/4.4)), pixelSize*1.5, 0, 2 * Math.PI, false);
|
||||||
}
|
ctx.fill();
|
||||||
|
} else {
|
||||||
|
ctx.fillStyle = "rgba(255,255,0,0.5)";
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.arc((pixel.x+0.5)*pixelSize+(18*Math.sin((pixel.y+incrementt)/4.4)), (pixel.y+0.5)*pixelSize+(18*Math.sin((pixel.x+incrementt)/4.4)), pixelSize/2, 0, 2 * Math.PI, false);
|
||||||
|
ctx.fill();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ((!paused) || forceTick) {pixelTicks++};
|
if ((!paused) || forceTick) {pixelTicks++};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue