diff --git a/docs/plans/2026-03-10-day-counter-indicator-design.md b/docs/plans/2026-03-10-day-counter-indicator-design.md new file mode 100644 index 0000000..65c1639 --- /dev/null +++ b/docs/plans/2026-03-10-day-counter-indicator-design.md @@ -0,0 +1,29 @@ +# Day Counter + 2x Indicator Design + +## Goal + +Add a day counter ("Day N") to the left of the day/night indicator, and double the indicator's size. + +## Approach + +Server computes `dayNumber` in GameLoop, sends it in StateUpdate. Client displays it. Existing inline day calculation in inventionSystem is replaced with the centralized method. + +## Server Changes + +- **GameLoop**: Add `getCycleTicks()` helper (extracted from `getGameTime()`), add `getDayNumber()` method +- **StateUpdate type** (`shared/src/types.ts`): Add `dayNumber: number` +- **SocketServer**: Include `dayNumber` in state broadcast +- **inventionSystem.ts**: Use `gameLoop.getDayNumber()` instead of inline cycle math + +## Client Changes + +- **TimeIndicator**: Double all dimensions (track 240px, height 16px, icons 20/18px, marker 6px, border 4px) +- **TimeIndicator**: Add "Day N" text element to the left of the track, same retro font +- **TimeIndicator.update()**: Accept `dayNumber` parameter, update text when it changes +- **GameScene**: Pass `dayNumber` from state updates to TimeIndicator + +## Data Flow + +``` +GameLoop.tick → getDayNumber() → StateUpdate.dayNumber → TimeIndicator.update(gameTime, dayNumber) +```