From 496a2a063f730ed54e6cfff37f17f2467dc4010d Mon Sep 17 00:00:00 2001 From: Jason Reed Date: Sun, 12 Nov 2023 10:47:24 -0500 Subject: [PATCH] Make timer "burn down" instead of "filling up" (fix #46) --- src/ui/instructions.tsx | 4 ++-- src/ui/render.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ui/instructions.tsx b/src/ui/instructions.tsx index 46f33a6..011b220 100644 --- a/src/ui/instructions.tsx +++ b/src/ui/instructions.tsx @@ -69,8 +69,8 @@ function render(ci: CanvasInfo, props: CanvasProps) { drawBubble(ci, `Click in this space (or hit [spacebar])\n to get more tiles.`, { x: 670, y: 347 }, { x: 732, y: 290 }); - drawBubble(ci, `This is the panic bar. If it\nfills up all the way to\nthe right, you lose!\nYou\x27re safe when your hand is\nempty, and all tiles form words.`, - { x: 133, y: 453 }, { x: 221, y: 593 }); + drawBubble(ci, `This is the panic bar. When it\nruns out, you lose!\nYou\x27re safe when your hand is\nempty, and all tiles form words.`, + { x: 163, y: 453 }, { x: 301, y: 593 }); d.restore(); } diff --git a/src/ui/render.ts b/src/ui/render.ts index f4da0f5..e7b79c0 100644 --- a/src/ui/render.ts +++ b/src/ui/render.ts @@ -246,11 +246,11 @@ export function rawPaint(ci: CanvasInfo, state: GameState) { const panic_fraction = getPanicFraction(state.panic); const panic_rect_in_canvas: Rect = { p: { - x: canvas_bds_in_canvas.p.x, + x: canvas_bds_in_canvas.p.x + canvas_bds_in_canvas.sz.x * panic_fraction, y: canvas_bds_in_canvas.p.y + canvas_bds_in_canvas.sz.y - PANIC_THICK, }, sz: { - x: canvas_bds_in_canvas.sz.x * panic_fraction, + x: canvas_bds_in_canvas.sz.x * (1 - panic_fraction), y: PANIC_THICK, } };