docs: add day counter + 2x indicator design

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
root
2026-03-10 19:09:05 +00:00
parent b32e0f8489
commit 4526ba908c
@@ -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)
```