Browser duel game prototype

Kamae:
Path of the Blade

A fencing duel played on a five-stance pentacle, in the browser, against a friend or an AI swordsman called Ronin.

How a duel works What runs today

Pixel-art valley with a waterfall, cherry blossom and mountains: the title-screen background of the game.
Title-screen landscape from the repository. AI-generated art (ImageGen).

What it is

Kamae is a two-player duel. Each fighter holds one of five stances, named for the five elements: Wood, Fire, Earth, Metal and Water. Each round you spend qi to shift stance, hold to gather more, then commit to an attack, a defence or a flowing move. How much damage lands depends on where your stance sits against your opponent's on the pentacle.

The repository is a Cloudflare Workers app with a D1 database. The browser client draws the arena on a canvas, with sprite sheets and layered landscapes, and the same engine file also runs under Node for tests. Duels can be played alone against Ronin, against another player online, or in a Journey mode with eight guardian fights on an animated map of Japan.

An honest note on origin

The repository describes itself as an independent fork of another site's source, taken at a fixed commit. Its database is independent and no original account records were copied. We are confirming rights with the original author, so treat the project as a prototype and not as something to redistribute until that is settled.

The pentacle and the rules

Solid: generation (next element). Dashed: control (two steps on). Drawn here from the engine's element order, not a game screenshot.

Rules below are read from client/engine.js, using the settings of rules version 6, the version the README says the fork preserves. The engine in the repository supports versions 1 to 9 and defaults to 9, so the numbers differ in newer versions. We have read this code; we have not played a full duel to check each figure.

IdeaWhat the code does (v6)
StancesFive, each guarding an area: Wood shoulders, Fire head, Earth legs, Metal sides, Water chest.
Qi and healthQi is capped at 9 and health is 20 in v6. (v7 raises qi to 10; v9 sets health to 100.)
ShiftingA shift costs 1 qi, or 2 when moving to the element that counters you. Shifting to the next element in the ring gives back 3 qi; two steps on gives back 1.
Hold and restHolding in place gains 1 qi; resting also gains 1.
StrikeThe attacker spends all their qi as raw damage. The defender can absorb it with their own qi, if their stance covers the attacking line.
DefenceMatching guard adds 2 to the defence, and defending from a stance that controls the attacker adds 4 and can counter.

Source: client/engine.js (kind, shiftCost, shiftRefund, maxQi, maxHp, guardPower, coverage)

What is in the repository

Each card says how far the feature goes, from the README and the code that backs it.

  • in code present and described in the README
  • prototype works, not fully checked
  • unverified claimed, not tested by us
  • Versioned rules in code

    The engine carries rules versions 1 to 9, and each recorded duel stores the version it was played under, so old replays still resolve the way they did.

    Source: client/engine.js (setRules, withRules)

  • Multiplayer unverified

    Accounts, challenges, friends, messages, a leaderboard and profiles are in the client and the Worker API, with D1 migrations. We did not run a live two-player match.

    Source: README; server/api.mjs; drizzle/

  • Replays and history in code

    Every exchange is stored as a snapshot and can be replayed in a cinema view with a speed control, plus a written battle history.

    Source: client/app.js (fightHistory, playFight)

  • Pentacle UI prototype

    You pick stances by moving around the pentacle. Phone layouts use a bottom stack of scrolls; the README says phone visual QA is still pending.

    Source: README (mobile scroll-shell sections)

  • Ronin, the AI opponent in code

    Three difficulties (novice, adept, veteran) and five personalities, one per element. It scores every option against every reply the opponent has, and thinks for a few seconds so it feels like a person.

    Source: client/ronin.js

  • Sensei guidance prototype

    An in-duel advisor and a paginated rules guide, with a training mode. The advisor is described in the README; we did not read its advice for correctness.

    Source: README; client/field-guide.js

  • Journey mode prototype

    An animated map of Japan with eight sequential trials. Each opens with an imagined conversation (the README says these are not historical quotations) before the duel. Progress syncs for account holders.

    Source: README (The swordsman's journey); client/journey-data.js

  • Animated pixel arenas in code

    Sprite-sheet fighters, layered landscapes and weather on a canvas. The README says ambient motion can be set to follow the device, on or off, and reduced motion is respected.

    Source: README (Graphics); client/pixel-renderer.js

  • Music and sound unverified

    The README lists menu, battle and victory tracks as user-supplied. We have not checked who holds the rights to them, so none are copied to this page.

    Source: README (Main-menu music)

Art from the repository

All of this art was generated with an AI image tool (the README names ImageGen) and then processed by scripts in the repository. The sheets below are source files; the game cuts them into animation frames.

Pixel-art shrine courtyard with a waterfall and cherry trees, the battle background.
Battle shrine backdrop. Character-free by design.
Illustrated map of Japan used for the Journey mode.
Journey map of Japan.
Sprite sheet of a red-robed swordsman in thirty strike and guard poses.
Fighter strike sheet (art-source/fighter-strikes.png), resized.
Eight-frame walk cycle of a young swordsman with a pack, seen from the side.
Overworld walk cycle, version 89 (art-source/overworld-walk-v89.png), resized.

Status

What we know, and what we do not. This page is built from reading the repository and its docs; we did not deploy it.

  • Runs, per the README in code

    Engine with versioned rules, Ronin, replays, the pentacle UI, Journey, Worker API and D1 migrations. The README reports engine, journey, encounter and renderer checks passing for the changes it describes.

  • Prototype prototype

    Phone layouts. The README repeats, section after section, that phone and browser visual QA is pending. We could not confirm any of it.

  • Known failing tests unverified

    A notes file in docs/next-steps.md records 115 tests passing and 86 failing, the same 86 failing on unmodified code. It is a working note, not a current run; we did not run the suite.

  • Not finished planned

    The notes list a pentacle navigation conversion, proper walk and jump stills, and real move and jump physics, which the engine does not have yet.

  • Rights unverified

    Independent fork; rights being confirmed with the original author. Art is AI-generated. Music is described as user-supplied. No licence file was found at the top of the repository.

  • Live site unverified

    The README gives no public address for this fork, and we make no claim that one exists.