Reference
Falling Triplets
import { … } from "@johnmorrisdotca/houseki/falling-triplets";
21.8 kB minified and gzipped, with everything it imports (measured with esbuild)
Exports
| Name | Kind | What it is |
|---|---|---|
Action | type | A native player action accepted or rejected according to the current phase and rules. |
actionsForTick | function | Resolves canonical actions in the design's per-tick order. |
advanceTicks | function | Advances fixed 60 Hz game ticks. |
applyAction | function | Applies and records one immutable action; rejected actions preserve state identity. |
CampaignLevel | type | One authored native challenge with its stable id, setup, winning witness, measurements and review status. |
campaignManifest | constant | The frozen native campaign manifest with its ordering, revisions, checksum and measured levels. |
CampaignManifest | type | The ordered native campaign, its generation/grading revisions, checksum and measured levels. |
ChallengeGoal | type | A native authored challenge objective; its discriminant selects target, chain, empty-board or score requirements. |
ChallengeGoalChain | type | A Falling Triplets objective requiring at least the supplied chain depth. |
ChallengeGoalEmpty | type | A Falling Triplets objective requiring an empty board. |
ChallengeGoalTargets | type | A Falling Triplets objective requiring the supplied stable target ids to be cleared. |
ChallengeHint | type | One witnessed Falling Triplets placement with a column and cycle orientation. |
ChallengeOptions | type | Authored challenge inputs including the starting board, finite goal and supplied witness. |
ChallengeSettings | type | The fixed Falling Triplets challenge settings with the original board and finite triplet queue. |
Colour | type | A gem colour ID. |
compactBoard | function | Compacts each column downward while preserving the top-to-bottom order of survivors. |
createChallenge | function | Creates a challenge after validating its authored board, finite queue, goal, and witness. |
createGame | function | Creates a deterministic empty game with an active piece and three-piece preview. |
createInputScheduler | function | Creates an empty fixed-tick input scheduler state. |
createLevel | function | Construct a fresh validated challenge state for a stable level ID or display number. |
CreateOptions | type | Creation settings for this native engine; dimensions, mode, seed and optional mechanics are validated together. |
decodeGame | function | Replays and validates a bounded save, then verifies its checkpoint against the derived state. |
DifficultyMetrics | type | The bounded engine measurements used to grade this campaign; they do not claim human difficulty. |
encodeGame | function | Encodes the authoritative settings, action recording, and derived checkpoint. |
findMatches | function | Finds the union of every maximal horizontal, vertical, and diagonal run of at least three. |
GameEvent | type | An event emitted by one native transition; type selects the event’s additional fields. |
GameState | type | The immutable authoritative native game state, including its board, random state and recording. |
Gem | type | A settled or active gem with a stable run-local identity. |
getLevel | function | Find a level by stable content ID or its current one-based display number. |
getTutorial | function | Find a lesson by its persistent ID. |
landingY | function | Returns the exact landing row for the current rigid triplet. |
legalActions | function | Lists the core actions currently available to the player. |
levelManifest | constant | The frozen ordered native levels; array indices start at zero and display numbers start at one. |
LocalizedText | type | One authored text in English and Japanese. |
Mode | type | The native game mode; authored challenges have fixed setup and queue rules. |
nextInt | function | Draws an unbiased integer and updated state using rejection sampling. |
nextUint32 | function | Advances the reference xorshift32 source. |
Phase | type | The native falling, resolution, pause and ending phases. |
Piece | type | The native falling triplet with stable gem ids, orientation, descent and lock counters. |
queueInputEdge | function | Queues a one-shot cycle, drop, or pause edge for the next logical tick. |
RecordedAction | type | One accepted canonical action and its logical tick position. |
releaseAllActions | function | Releases every held action after blur, pause, or pointer cancellation. |
restartGame | function | Recreates the same authored mode, seed, and challenge configuration from its original setup. |
seedState | function | Hashes a string seed with UTF-8 FNV-1a and returns a nonzero uint32 state. |
setHeldAction | function | Starts or releases one held action; opposite lateral holds cancel during scheduling. |
Settings | type | Validated settings fixed at native game creation. |
statusOf | function | Returns a plain status summary suitable for UI labels. |
Transition | type | The resulting native state, emitted events and acceptance decision; rejected actions preserve the input. |
Triplet | type | Three ordered gem colours composing one falling triplet. |
TutorialDefinition | type | One bilingual native lesson with its authored setup, teaching steps and winning witness. |
tutorialManifest | constant | The frozen native bilingual lessons and their authored teaching steps. |
TutorialStep | type | One bilingual native lesson instruction and the corresponding action or tick step. |
Wave | type | One simultaneous native match wave, its cleared cells and chain score. |