diff options
Diffstat (limited to 'test-client')
-rw-r--r-- | test-client/main.ts | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/test-client/main.ts b/test-client/main.ts index 4c755e55..bfd352b3 100644 --- a/test-client/main.ts +++ b/test-client/main.ts @@ -68,7 +68,8 @@ let scale = 0 function send(p: PacketS) { ws.send(JSON.stringify(p)) } function packet(p: PacketC) { - if (!["position", "set_active"].includes(p.type)) console.log(p); + if (!["position", "set_active"].includes(p.type)) + console.log(p); switch (p.type) { case "init": my_id = p.id @@ -101,7 +102,7 @@ function packet(p: PacketC) { case "put_item": { const player = players.get(p.player)! const tile = tiles.get(p.tile.toString())! - tile.item = player.item; + tile.item = player.item player.item = undefined break; } @@ -277,10 +278,7 @@ function draw_ingame() { } for (const [_, tile] of tiles) { - ctx.save() - ctx.translate(tile.x, tile.y) if (tile.item) draw_item(tile.item) - ctx.restore() } draw_interact_target() @@ -297,7 +295,7 @@ function draw_item(item: ItemData) { } if (item.progress !== null && item.progress !== undefined) { ctx.fillStyle = "rgba(115, 230, 58, 0.66)" - ctx.fillRect(0, 0, 1, item.progress) + ctx.fillRect(-0.5, -0.5, 1, item.progress) } ctx.restore() } |