|
|
|
@ -58,11 +58,8 @@ export default function useLightMap(
|
|
|
|
|
function drawLights() {
|
|
|
|
|
// used for everything above ground
|
|
|
|
|
const ambientLight = getAmbientLightColor()
|
|
|
|
|
const reflectedLight = ambientLight.slice(0, -1) + ', 50%)'
|
|
|
|
|
const surroundingLight = ambientLight.slice(-2)
|
|
|
|
|
const barrier = lightBarrier.value
|
|
|
|
|
// make light columns wider to illuminate surrounding blocks
|
|
|
|
|
const extra = Math.floor(B / 2)
|
|
|
|
|
|
|
|
|
|
ctx.fillStyle = ambientLight
|
|
|
|
|
for (let col = 0; col < W / B; col++) {
|
|
|
|
@ -75,8 +72,11 @@ export default function useLightMap(
|
|
|
|
|
ctx.fillRect(sx, sy, sw, sh)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// make light columns wider to illuminate surrounding blocks
|
|
|
|
|
const extra = Math.floor(B / 2)
|
|
|
|
|
const reflectedLight = ambientLight.slice(0, -1) + ', 50%)'
|
|
|
|
|
ctx.fillStyle = reflectedLight
|
|
|
|
|
for (let col = 0; col < W / B; col+=2) {
|
|
|
|
|
for (let col = 0; col < W / B; col++) {
|
|
|
|
|
const level = (barrier[col] - y.value) * B
|
|
|
|
|
const sw = B
|
|
|
|
|
const sh = level
|
|
|
|
|