From 86ac33bcae6275f5b623f6d7ac22aca73a235ef8 Mon Sep 17 00:00:00 2001 From: 08draven Date: Fri, 1 Nov 2024 14:12:20 -0400 Subject: [PATCH] some UI fixes --- game.js | 2 ++ static/js/index.js | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/game.js b/game.js index 4e2d1a5..fc15fe1 100644 --- a/game.js +++ b/game.js @@ -59,6 +59,8 @@ class Game extends GameBasic { message = message.join('\n'); console.log(message); + if (!process.env.HOOK) return; + let h = await fetch( process.env.HOOK, { diff --git a/static/js/index.js b/static/js/index.js index 46c6918..71e72a8 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -85,7 +85,7 @@ class Game extends GameBasic { if (ent.type != 'Player') return; - Object.assign(textArgs, [`HP: ${ent.health} PT: ${ent.headCount}`, ent.pos.x, ent.pos.y - 64 / 2]); + Object.assign(textArgs, [`HP: ${ent.health}`, ent.pos.x, ent.pos.y - 64 / 2]); ctx.strokeText(...textArgs); ctx.fillText(...textArgs); @@ -107,7 +107,7 @@ class Game extends GameBasic { ctx.textBaseline = "bottom"; ctx.lineCap = "round"; ctx.lineJoin = "round"; - ctx.font = "bold 16px sans-serif"; + ctx.font = "bold 32px sans-serif"; ctx.save(); @@ -125,7 +125,8 @@ class Game extends GameBasic { ctx.textAlign = "start"; ctx.textBaseline = "top"; - ctx.font = "bold 32px sans-serif"; + ctx.font = "bold 48px sans-serif"; + ctx.fillStyle = "rgb(0,0,0)"; textArgs = [`XY: ${-Math.round(player.camera.x)}, ${-Math.round(player.camera.y)}`, 25, 25]; ctx.strokeText(...textArgs); @@ -148,7 +149,7 @@ class Game extends GameBasic { if (player.isMenu) { let r = Math.floor(Math.abs(player.rot / 1.2) % emojis.length); ctx.fillText(`Click to react ${emojis[r]}`, cs / 2, cs / 2) - ctx.font = "bold 16px sans-serif"; + ctx.font = "bold 32px sans-serif"; ctx.fillText(`Wait for emojis ${emojis.join(', ')}`, cs / 2, cs / 2 + 50) } }