diff options
| author | metamuffin <metamuffin@disroot.org> | 2024-06-18 11:42:36 +0200 | 
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2024-06-23 19:20:50 +0200 | 
| commit | 101ef75240e5d94f182fa1f15b58881c39221cfa (patch) | |
| tree | 5ac304a09e134abf4f159b7889e91e0a35d02463 | |
| parent | 3e8c24375f064487365a66c20fba20bea8e1f860 (diff) | |
| download | hurrycurry-101ef75240e5d94f182fa1f15b58881c39221cfa.tar hurrycurry-101ef75240e5d94f182fa1f15b58881c39221cfa.tar.bz2 hurrycurry-101ef75240e5d94f182fa1f15b58881c39221cfa.tar.zst | |
more item sprites
| -rw-r--r-- | data/recipes.yaml | 1 | ||||
| -rw-r--r-- | server/src/game.rs | 2 | ||||
| -rw-r--r-- | test-client/tiles.ts | 27 | 
3 files changed, 29 insertions, 1 deletions
| diff --git a/data/recipes.yaml b/data/recipes.yaml index e76b2f5e..8c59a057 100644 --- a/data/recipes.yaml +++ b/data/recipes.yaml @@ -3,6 +3,7 @@  - { tile: counter, inputs: [steak-meal, void] }  - { tile: counter, inputs: [sliced-tomato-meal, void] }  - { tile: counter, inputs: [bread-meal, void] } +- { tile: counter, inputs: [burger-meal, void] }  - { tile: counter, inputs: [tomatosteak-meal, void] }  - { tile: counter, inputs: [tomatoburger-meal, void] } diff --git a/server/src/game.rs b/server/src/game.rs index 4f724446..f91e42d0 100644 --- a/server/src/game.rs +++ b/server/src/game.rs @@ -80,6 +80,8 @@ impl Game {              [                  ([1, 4], "pan"),                  ([2, 4], "pan"), +                ([-1, 4], "oven"), +                ([-2, 4], "oven"),                  ([-5, 2], "sink"),                  ([-5, 3], "dirty-plate-spawn"),                  ([4, 0], "flour-spawn"), 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"), | 
