aboutsummaryrefslogtreecommitdiff
path: root/test-client/tiles.ts
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-06-18 10:17:40 +0200
committermetamuffin <metamuffin@disroot.org>2024-06-23 19:20:50 +0200
commit20a978e4f91e03588bf89d2426ee215f176b1ac7 (patch)
treeb99bd5b52dbd7cc31cec9bfcf79a197184f72a40 /test-client/tiles.ts
parent9bdb81bb34bd6a7e33c47d6fcb3dced1c5bda991 (diff)
downloadhurrycurry-20a978e4f91e03588bf89d2426ee215f176b1ac7.tar
hurrycurry-20a978e4f91e03588bf89d2426ee215f176b1ac7.tar.bz2
hurrycurry-20a978e4f91e03588bf89d2426ee215f176b1ac7.tar.zst
passive recipes work
Diffstat (limited to 'test-client/tiles.ts')
-rw-r--r--test-client/tiles.ts12
1 files changed, 9 insertions, 3 deletions
diff --git a/test-client/tiles.ts b/test-client/tiles.ts
index 6eb1dc29..c628ea5d 100644
--- a/test-client/tiles.ts
+++ b/test-client/tiles.ts
@@ -7,8 +7,8 @@ function base(fill: string, stroke?: string, stroke_width?: number): Component {
c.lineWidth = stroke_width ?? 0.05
c.lineJoin = "miter"
c.lineCap = "square"
- c.fillRect(0, 0, 1, 1)
- if (stroke) c.strokeRect(c.lineWidth / 2, c.lineWidth / 2, 1 - c.lineWidth, 1 - c.lineWidth)
+ c.fillRect(-0.5, -0.5, 1,1)
+ if (stroke) c.strokeRect(-0.5 + c.lineWidth / 2, -0.5 + c.lineWidth / 2, 1 - c.lineWidth, 1 - c.lineWidth)
}
}
function circle(radius: number, fill: string, stroke?: string, stroke_width?: number): Component {
@@ -17,7 +17,7 @@ function circle(radius: number, fill: string, stroke?: string, stroke_width?: nu
c.strokeStyle = stroke ?? "black";
c.lineWidth = stroke_width ?? 0.05
c.beginPath()
- c.arc(0.5, 0.5, radius, 0, Math.PI * 2)
+ c.arc(0.0, 0.0, radius, 0, Math.PI * 2)
if (stroke) c.stroke()
c.fill()
}
@@ -33,3 +33,9 @@ export const TILES: { [key: string]: Component[] } = {
"pan": [...table, circle(0.4, "#444", "#999")],
"flour_bag": [...floor, circle(0.5, "#fff", "#ddd")],
}
+
+export const FALLBACK_ITEM: Component[] = [circle(0.3, "#f0f")];
+export const ITEMS: { [key: string]: Component[] } = {
+ "raw-steak": [circle(0.3, "rgb(204, 55, 5)")],
+ "steak": [circle(0.3, "rgb(112, 34, 0)")],
+}