|
|
|
@ -55,23 +55,6 @@ export default function useLightMap(
|
|
|
|
|
ctx.fillRect(0, 0, W, H)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function drawShadows() {
|
|
|
|
|
const barrier = lightBarrier.value
|
|
|
|
|
|
|
|
|
|
ctx.fillStyle = '#000A'
|
|
|
|
|
for (let col = 0; col < W / B; col++) {
|
|
|
|
|
const level = (barrier[col] - y.value) * B
|
|
|
|
|
const sw = B
|
|
|
|
|
const sh = H - level
|
|
|
|
|
const sx = col * sw
|
|
|
|
|
const sy = level
|
|
|
|
|
|
|
|
|
|
ctx.fillRect(sx, sy, sw, sh)
|
|
|
|
|
ctx.fillRect(sx, sy + 20, sw, sh)
|
|
|
|
|
ctx.fillRect(sx, sy + 40, sw, sh)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function drawLights() {
|
|
|
|
|
// used for everything above ground
|
|
|
|
|
const ambientLight = getAmbientLightColor()
|
|
|
|
|