import { Color } from 'cc'; /** * Shared visual constants. Anything a layout or a colour is tuned by lives here * rather than being typed into each scene, so a change lands everywhere at once * and the scene files stay free of magic numbers. * * Lengths are in design units — the screen is always exactly 1080 wide, see * docs/DECISIONS.md. */ export const Layout = { designWidth: 1080, designHeight: 1920, /** Card sprite size, matching what scripts/build-art.mjs produces. */ cardWidth: 220, cardHeight: 320, /** Cards on the table are drawn smaller so six pairs fit comfortably. */ tableCardScale: 0.62, /** The opponent's hand is smaller again — it is only ever card backs. */ opponentCardScale: 0.5, /** Horizontal step between neighbouring cards in the player's hand. */ handStep: 128, /** Never let a hand grow wider than this; the step shrinks instead. */ handMaxWidth: 940, /** How far the tapped card lifts out of the hand. */ handLift: 48, /** Offset of a beating card from the card it beats. */ beatOffset: { x: 26, y: -34 }, /** Comfortable minimum for anything tappable, per docs/UI.md. */ minTapSize: 120, screenMargin: 40, /** * Where things sit on the table, in canvas coordinates (origin at the * centre, y up). Vertical positions stay well inside the 1080×1920 design * area so that a 4:3 screen — which crops the top and bottom — still shows * every one of them. See docs/DECISIONS.md. */ region: { opponentHandY: 600, opponentLabelY: 770, deck: { x: -390, y: 150 }, trump: { x: -300, y: 120 }, discard: { x: 430, y: 150 }, /** Centre of the first table row; the second row sits a row-height below. */ tableTopY: -20, tableRowStep: 235, tableColumnStep: 180, messageY: 330, actionBarY: -430, playerHandY: -700, }, } as const; export const Palette = { gold: new Color(244, 194, 69, 255), cream: new Color(247, 240, 222, 255), dim: new Color(174, 196, 182, 255), good: new Color(126, 217, 140, 255), bad: new Color(232, 116, 104, 255), shade: new Color(0, 0, 0, 170), } as const; /** How long the standard card movements take, in seconds. */ export const Timing = { deal: 0.28, dealStagger: 0.06, play: 0.22, collect: 0.3, flip: 0.16, /** Pause before the bot acts, so its moves can be followed. */ botThinking: 0.55, /** Pause after a turn resolves, before the next one starts. */ turnBreak: 0.4, } as const;