a more robust system for syncing chunks

as long as the server tells you there are more chunks, there are definitely more chunks.
just wait for them a bit.
This commit is contained in:
りき萌 2024-08-17 22:16:31 +02:00
parent 2f7bcbb14e
commit 2594afcc1b
6 changed files with 57 additions and 49 deletions

View file

@ -87,8 +87,13 @@ class CanvasRenderer extends HTMLElement {
let chunk = this.wall.getChunk(chunkX, chunkY);
if (chunk != null) {
this.ctx.globalCompositeOperation = "source-over";
this.ctx.drawImage(chunk.canvas, x, y);
}
this.ctx.globalCompositeOperation = "difference";
this.ctx.fillStyle = "white";
this.ctx.fillText(`${chunkX}, ${chunkY}`, x, y + 12);
}
}