M5-M7: сцены, лобби, экран игры и цикл матча
Обе сцены собраны через Code Mode, не руками. - loader: поднимает модули, прогревает арт карт, уходит в lobby - lobby: обе UI-ветки в одной сцене (по ARCHITECTURE.md), матч — это смена видимого корня, а не загрузка сцены - GameScreen рисует текущее состояние и доводит узлы твинами, а не проигрывает поток событий: узел карты живёт вместе со своей картой, поэтому "шестёрка ушла из руки на стол" не требует отдельного случая - один тап = ход целиком; логика вынесена в core/rules/intent.ts и покрыта тестами, в том числе проверкой, что она никогда не предложит ход, который правила отвергнут - арт карт переехал в assets/resources: .pac — это инструкция упаковки на сборке, а не рантайм-ассет, и без ссылок на кадры в сборку не попадало ничего. Теперь все 37 спрайтов в одной текстуре 2048x2048 - клики кнопок подписываются в коде, а не через clickEvents сцены - строки интерфейса собраны в одном файле Сборка web-mobile проходит чисто, все ссылки в сцене проверены. Вживую не запускалось: браузер в этом окружении не поднимает главный цикл движка. Подробности — в docs/TECHNICAL.md. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+63
-1
@@ -95,5 +95,67 @@ and bottom bars.
|
||||
|
||||
**Decision.** Use the 36 faces needed for a durak deck, rendered from the SVG
|
||||
sources so the downscale to the 1080-wide budget stays sharp. Attribution and
|
||||
licence text are recorded in `assets/art/cards/ATTRIBUTION.md`. The card back,
|
||||
licence text are recorded in `assets/resources/cards/ATTRIBUTION.md`. The card back,
|
||||
table surface and UI chrome are not in that set and are authored for this project.
|
||||
|
||||
## 2026-09-13 · Presentation · The screen renders state, it does not replay events
|
||||
|
||||
The rules emit an event stream, which invites an animation queue that replays it.
|
||||
|
||||
**Decision.** `GameScreen.render(state)` lays the whole table out from the current
|
||||
state and tweens every card node to its new place. A card node stays bound to its
|
||||
`Card` for as long as that card is visible.
|
||||
|
||||
**Why.** "The six of clubs moved from my hand to the table" then needs no special
|
||||
case — it is the same node arriving at a new position. An event-driven queue has
|
||||
to choreograph every transition by hand and desynchronises the moment one case is
|
||||
missed. The event stream is still there for sound and for one-off flourishes.
|
||||
|
||||
## 2026-09-13 · Presentation · Card art lives in the `resources` bundle
|
||||
|
||||
The first attempt gave `CardLibrary` a `SpriteAtlas` reference to the auto-atlas
|
||||
(`cards.pac`) and asked it for frames by name. The build came out with no card
|
||||
textures at all.
|
||||
|
||||
**Decision.** The 36 faces and the back live in `assets/resources/cards` and are
|
||||
loaded with `resources.loadDir`. `Bootstrap` preloads the folder in the loader
|
||||
scene, so the lobby never waits.
|
||||
|
||||
**Why.** A `.pac` is a build-time packing instruction, not a runtime asset: it
|
||||
packs whatever sprite frames the build already pulled in, and it cannot be loaded
|
||||
and queried by name. Nothing referenced the individual frames, so nothing was
|
||||
packed. The `.pac` still earns its keep — all 37 sprites end up in one 2048²
|
||||
texture, so the whole table costs one draw call.
|
||||
|
||||
## 2026-09-13 · Presentation · Button clicks are wired in code
|
||||
|
||||
**Decision.** Buttons are exposed as `@property(Button)` and subscribed to in
|
||||
`onLoad` rather than through the scene's `clickEvents` list.
|
||||
|
||||
**Why.** The wiring stays visible in the source, and renaming a handler becomes a
|
||||
compile error instead of a button that silently stops working. (The editor tool
|
||||
server also cannot write array-typed properties, which is how `clickEvents` is
|
||||
stored — so this was the only option available to automation anyway.)
|
||||
|
||||
## 2026-09-13 · Presentation · Interface text is English, collected in one file
|
||||
|
||||
**Decision.** Every player-visible string is in
|
||||
`assets/scripts/ui/common/Strings.ts`, in English.
|
||||
|
||||
**Why.** The specs, the code and the docs are all in English, and localisation is
|
||||
out of scope for iteration 1. Keeping the strings together means switching
|
||||
language — or adding one — is a change to that one file rather than a hunt
|
||||
through scenes and components. Worth revisiting before release, given the game
|
||||
is *durak*.
|
||||
|
||||
## 2026-09-13 · Presentation · One tap is the whole interaction
|
||||
|
||||
**Decision.** Tapping a card plays it. When defending, the attack being answered
|
||||
is worked out from the card rather than selected separately. The logic lives in
|
||||
`core/rules/intent.ts`, not in the component.
|
||||
|
||||
**Why.** Select-then-target doubles the taps for no gain, because the serialised
|
||||
rules leave only one unanswered attack at a time. Putting it in the core means
|
||||
the one piece of interface logic that can silently reject a legal move is covered
|
||||
by headless tests, including a property test that it never proposes an action the
|
||||
rules would refuse.
|
||||
|
||||
Reference in New Issue
Block a user