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:
parent
2f7bcbb14e
commit
2594afcc1b
6 changed files with 57 additions and 49 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue