diff --git a/game.json b/game.json index ff865d5..80fc522 100644 --- a/game.json +++ b/game.json @@ -3,7 +3,7 @@ "start_room": 0, "intro_text": "Victoria, BC. 1979. You are Rob Wright, twenty-five, back from Calgary with a bass guitar and no plan. Your kid brother can really drum. The basement is free after laundry hours. (Right-click cycles verbs. Or just type.)", "max_score": 60, - "ego_sprite": "rob", + "ego_sprite": "rob-sheet2x3", "verbs": { "play": "jam riff shred strum drum", "listen": "hear" diff --git a/sprites/rob-sheet2x3.png b/sprites/rob-sheet2x3.png new file mode 100644 index 0000000..323e7b0 Binary files /dev/null and b/sprites/rob-sheet2x3.png differ diff --git a/sprites/rob.png b/sprites/rob.png deleted file mode 100644 index e58a09a..0000000 Binary files a/sprites/rob.png and /dev/null differ diff --git a/tools/gen_sprites.py b/tools/gen_sprites.py index 0bfe2cd..3b7fe0b 100755 --- a/tools/gen_sprites.py +++ b/tools/gen_sprites.py @@ -41,40 +41,116 @@ def write_png(path, rows, legend, scale=1): S = {} # name -> (rows, legend) # --- people ------------------------------------------------------------- -# Rob Wright — the ego. Tall, calm, bass slung low. (Feet = bottom center.) -S["rob"] = ( - [ - "....hhhh....", - "....hhhh....", - "....ffff....", - "....f2f2....", - "....ffff....", - ".....ff.....", - "...ssssss...", - "..ssssssss..", - "..s.ssss.s..", - "..s.ssss.s..", - "..b.ssss....", - ".bbbrssss...", - ".bb.ssss....", - "..b.pppp....", - "....pppp....", - "....p..p....", - "....p..p....", - "....p..p....", - "....p..p....", - "...oo..oo...", - ], - { - "h": (72, 52, 36), # hair - "f": (214, 178, 148),# face - "2": (40, 40, 48), # eyes - "s": (52, 56, 64), # dark shirt - "p": (44, 48, 88), # jeans - "o": (30, 30, 34), # boots - "b": (150, 60, 40), # bass body - "r": (220, 200, 160),# bass neck - }, +# Rob Wright — the ego, as an MRPCI sprite sheet (`-sheet2x3`): 2 walk +# frames x 3 direction loops (front, back, side; the engine mirrors side +# for right-facing). Every cel is exactly 12x20; feet = bottom center. +ROB_LEGEND = { + "h": (72, 52, 36), # hair + "f": (214, 178, 148),# face + "2": (40, 40, 48), # eyes + "s": (52, 56, 64), # dark shirt + "p": (44, 48, 88), # jeans + "o": (30, 30, 34), # boots / strap + "b": (150, 60, 40), # bass body + "r": (220, 200, 160),# bass neck +} + +ROB_FRONT0 = [ + "....hhhh....", + "....hhhh....", + "....ffff....", + "....f2f2....", + "....ffff....", + ".....ff.....", + "...ssssss...", + "..ssssssss..", + "..s.ssss.s..", + "..s.ssss.s..", + "..b.ssss....", + ".bbbrssss...", + ".bb.ssss....", + "..b.pppp....", + "....pppp....", + "....p..p....", + "....p..p....", + "....p..p....", + "....p..p....", + "...oo..oo...", +] +# Frame 2: the walk bob — boots swing in. +ROB_FRONT1 = ROB_FRONT0[:19] + ["....oo.oo..."] + +ROB_BACK0 = [ + "....hhhh....", + "....hhhh....", + "....hhhh....", + "....hhhh....", + ".....ff.....", + "...ssssss...", + "..sossssss..", + "..s.osss.s..", + "..s.soss.s..", + "....ssos....", + "....ssso....", + "....sssso...", + "....ssss....", + "....pppp....", + "....pppp....", + "....p..p....", + "....p..p....", + "....p..p....", + "....p..p....", + "...oo..oo...", +] +ROB_BACK1 = ROB_BACK0[:19] + ["....oo.oo..."] + +# Side faces LEFT (MRPCI mirrors it for right); bass rides the front hip. +ROB_SIDE0 = [ + "....hhhh....", + "....hhhh....", + "....ffff....", + "....2fff....", + "....ffff....", + ".....ff.....", + "....ssss....", + "...ssssss...", + "...ssssss...", + "...ssssss...", + "..brssss....", + ".rbbssss....", + "..b.ssss....", + "....pppp....", + "....pppp....", + "....pp......", + "....pp......", + "....pp......", + "....pp......", + "...oooo.....", +] +ROB_SIDE1 = ROB_SIDE0[:15] + [ + "...p..p.....", + "...p..p.....", + "..p....p....", + "..p....p....", + ".oo....oo...", +] + + +def sheet(*loops): + """Stack loops vertically, frames horizontally — the -sheetCxR layout.""" + rows = [] + for cels in loops: + for cel in cels: + assert len(cel) == len(cels[0]), "frames in a loop must share height" + assert all(len(r) == len(cel[0]) for r in cel), "cels must be rectangular" + for y in range(len(cels[0])): + rows.append("".join(c[y] for c in cels)) + return rows + + +S["rob-sheet2x3"] = ( + sheet([ROB_FRONT0, ROB_FRONT1], [ROB_BACK0, ROB_BACK1], [ROB_SIDE0, ROB_SIDE1]), + ROB_LEGEND, ) # John Wright — behind the kit or beside it; sticks in hand.