PURPOSE
Mission node selection screen. Presents a list of hardcoded starter mission nodes, lets the player pick one, assembles a RunDefinition from the session store’s ship selection plus the chosen node, writes it back to the session store, and navigates to the gameplay route.
OWNS
- The
LevelSelectScreenReact component (default route render). - The
MissionNodeinterface used internally to describe display rows. - The
MISSION_NODESconstant — five hardcoded starter nodes (sector_1a,sector_1b,sector_2a,sector_2b,sector_3a) with id, label, missionType, heat, biome, timerSeconds, and desc. - The
TYPE_COLORSmap from mission type string to hex color (explore,deliver,defend,defeat,steal,heist,escort,capture). - The local
selectedNodestate (mission node id string). - The
HeatDotssubcomponent that renders ten dots, filled up to the heat value, colored green / yellow / red by tier. - The
hexToRgbhelper that parses a#rrggbbstring into a comma-joinedr,g,bstring for inline rgba backgrounds. - The
handleLaunchcallback that assembles the run definition and navigates.
READS FROM
useSessionStore—selectedShipId(passed into the assembled run definition).react-router-dom—useNavigatefor programmatic navigation.../services/assembleRunService—assembleRunDefto build theRunDefinitionfrom ship id and node fields.
PUSHES TO
useSessionStore.setRunDef— writes the assembledRunDefinitioninto the session store before navigation.- Router — navigates to
/games/starship-survivors/playon launch. - The home route
/via aLinkin the header.
DOES NOT
- Does not read from or write to a progression or metagame store; the node list is hardcoded in this file.
- Does not generate nodes from a sector graph or other procedural source.
- Does not validate the ship selection — if
selectedShipIdis falsy the run definition is still assembled with whatever the assemble service produces. - Does not gate launch behind any unlock, currency, or fuel check.
- Does not persist the last-selected node across mounts;
selectedNodedefaults to the first node every time. - Does not handle missions with mission types outside the
TYPE_COLORSmap specially; the fallback color is hardcoded to the explore green. - Does not surface biome to the player in the UI even though it is part of the node data and is passed to the assemble service.
Signals
- Click on a mission node button — sets
selectedNodeto that node id and re-renders the list with the selected styling. - Click on the LAUNCH MISSION button — invokes
handleLaunch, which looks up the selected node, assembles the run, stores it, and navigates. - Click on the HOME link — routes back to
/.
Entry points
LevelSelectScreen— named export, mounted by the app router for the level-select route.
Pattern notes
- Hardcoded data table at module scope (
MISSION_NODES) — flagged in the comment as temporary until progression / metagame generates nodes. TYPE_COLORSincludes mission types not present in the currentMISSION_NODESlist (steal,heist,escort,capture) — anticipates future node types without code changes.- Heat color tiers are inline in
HeatDotsrather than constants:<=3green,<=6yellow, otherwise red. - Timer display is suppressed when
timerSeconds === 0(used by the boss-arena node). - Selected-state styling derives the row background from the type color via
hexToRgbplus0.1alpha, and the border switches from a low-alpha white to the full type color. - Launch button is fixed to the bottom of the viewport with a gradient backdrop; the page reserves
pb-24so list content can scroll behind it. - All styling is a mix of Tailwind utility classes and inline
styleobjects; the screen’s color palette is local rather than pulled from a theme module.