aboutsummaryrefslogtreecommitdiff
path: root/test-client/tiles.ts
diff options
context:
space:
mode:
Diffstat (limited to 'test-client/tiles.ts')
-rw-r--r--test-client/tiles.ts27
1 files changed, 26 insertions, 1 deletions
diff --git a/test-client/tiles.ts b/test-client/tiles.ts
index 883ab7cb..57d96c0f 100644
--- a/test-client/tiles.ts
+++ b/test-client/tiles.ts
@@ -36,6 +36,25 @@ function cross(size: number, stroke: string, stroke_width = 0.05): Component {
}
}
+function arrange_items(...items: string[]): Component[] {
+ return items.flatMap((item, index) => {
+ const t = index / items.length * Math.PI * 2.
+ const radius = items.length == 1 ? 0 : (0.4 / items.length)
+ const off_x = Math.sin(t) * radius
+ const off_y = Math.cos(t) * radius
+ const scale = 1. / Math.sqrt(items.length)
+ return c => {
+ for (const comp of ITEMS[item]) {
+ c.save()
+ c.translate(off_x, off_y)
+ c.scale(scale, scale)
+ comp(c)
+ c.restore()
+ }
+ }
+ })
+}
+
const plate = [circle(0.4, "#b6b6b6", "#f7f7f7", 0.02)];
export const FALLBACK_ITEM: Component[] = [circle(0.3, "#f0f")];
@@ -44,10 +63,15 @@ export const ITEMS: { [key: string]: Component[] } = {
"steak": [circle(0.3, "#702200")],
"flour": [circle(0.3, "#d8c9c2")],
"dough": [circle(0.3, "#b38d7d")],
+ "bread": [circle(0.3, "#853e20")],
"tomato": [circle(0.3, "#d63838")],
+ "sliced-tomato": [circle(0.3, "#d16363", "#d63838", 0.08)],
"dirty-plate": [circle(0.4, "#947a6f", "#d3a187", 0.02)],
"plate": plate,
- "steak-meal": [...plate, circle(0.3, "#702200")],
+ "steak-meal": [...plate, ...arrange_items("steak")],
+ "sliced-tomato-meal": [...plate, ...arrange_items("sliced-tomato")],
+ "burger-meal": [...plate, ...arrange_items("bread", "steak")],
+ "tomatoburger-meal": [...plate, ...arrange_items("bread", "steak", "tomato")],
}
const table = [base("rgb(133, 76, 38)")];
@@ -61,6 +85,7 @@ export const TILES: { [key: string]: Component[] } = {
"counter": [base("rgb(182, 172, 164)")],
"trash": [...floor, circle(0.4, "rgb(20, 20, 20)"), cross(0.3, "rgb(90, 36, 36)")],
"sink": [base("rgb(131, 129, 161)", "rgb(177, 174, 226)", 0.2)],
+ "oven": [base("rgb(241, 97, 61)", "rgb(109, 84, 84)", 0.3)],
"pan": [...table, circle(0.4, "#444", "#999")],
"flour-spawn": spawn("flour"),
"dirty-plate-spawn": spawn("dirty-plate"),