本文へ移動

Houseki宝石

5つの宝石と石のゲームの仕組みを使い、測定したチャレンジやレッスンで遊び、再現できるゲームを保存できます。

宝石(ほうせき)は、宝石や貴石を意味する日本語です。 名前について(英語)

目次

リファレンス

磁石ブロック

import { … } from "@johnmorrisdotca/houseki/magnetic-blocks";

最小化と gzip 圧縮をしたサイズは 28.2 kB(読み込むものをすべて含み、esbuild で計測)

リファレンスの説明と例は英語です。見出しと目次は日本語です。

エクスポート

名前種類概要
Action型A native player action accepted or rejected according to the current phase and rules.
advanceTicks関数Advances fixed 60 Hz time, resolving phases in all modes and falling/locking only in Arcade.
applyAction関数Applies one movement, rotation, floor-switch or placement action without mutation.
Block型The native active 2×2 block, orientation and fixed-tick descent/lock counters.
blockBonds関数List the native stable-id bonds connecting adjacent gems in the active block.
blockCells関数Returns stable-gem addresses after rotating the square block around its centre.
Bond型An undirected stable-id connection between two gems in a magnetic block.
calmGravity関数Settles bonded connected components one cell per deterministic bottom/ID priority step.
campaignManifest定数The frozen native campaign manifest with its ordering, revisions, checksum and measured levels.
canPlace関数Test whether the whole native block fits passable empty board cells.
Colour型A standard gem colour used by a magnetic block.
createGame関数Creates an immutable seeded 2×2-block game with a fixed queue and explicit floor schedule.
createLesson関数Creates a fresh lesson game with its authored setup and queue.
createLevel関数Creates a fresh game with the authored rules, board, queue, and finite move budget.
CreateOptions型Creation settings for this native engine; dimensions, mode, seed and optional mechanics are validated together.
decodeGame関数Replays bounded canonical input and verifies every saved checkpoint field.
encodeGame関数Encodes canonical settings, accepted tick-stamped actions and a verified replay checkpoint.
Floor型The native calm or magnetic floor used when settling blocks.
FloorSchedule型A fixed, periodic or authored schedule selecting the floor for committed block placements.
GameEvent型An event emitted by one native transition; type selects the event’s additional fields.
GameState型The immutable authoritative native game state, including its board, random state and recording.
GameStatus型A compact native status derived from the authoritative state for a host’s labels.
Gem型A native gem with a stable run-local id and colour.
getLesson関数Finds one of the three bilingual rules lessons by stable ID.
getLevel関数Finds a Magnetic Blocks campaign level by stable ID or one-based display number.
getTutorial関数Find a magnetic-block lesson by stable id; returns undefined when no lesson has that id.
Goal型The native authored goal; its discriminant selects the required collection or clearing condition.
GRAVITY_TICKS定数Fixed 60 Hz ticks in the magnetic-block gravity phase.
impactSupportIds関数Collects the occupied one-cell support layer under both block columns at first contact.
landingY関数Find the last legal block row before downward collision.
legalActions関数Lists accepted controls for the current falling or resolution phase.
lessonManifest定数The frozen native bilingual lessons and their authored teaching steps.
levelManifest定数The frozen ordered native levels; array indices start at zero and display numbers start at one.
LocalizedText型One authored text in English and Japanese.
MagneticBlocksOptionsErrorクラスA typed native magnetic-block setup validation error.
MagneticCampaignLevel型One authored native challenge with its stable id, setup, winning witness, measurements and review status.
MagneticCampaignManifest型The ordered native campaign, its generation/grading revisions, checksum and measured levels.
MagneticDifficultyMetrics型The bounded engine measurements used to grade this campaign; they do not claim human difficulty.
magneticGravity関数Magnetic floor removes all bonds and settles each column segment independently.
MagneticLesson型One bilingual native lesson with its authored setup, teaching steps and winning witness.
MARK_TICKS定数The fixed 60 Hz ticks showing the magnetic-block match mark phase.
matchGroups関数Computes deterministic orthogonal colour components of at least four gems.
Mode型The native game mode; authored challenges have fixed setup and queue rules.
Phase型The native falling, resolution, pause and ending phases.
RecordedAction型A native action recording with the logical position needed for deterministic replay.
REMOVE_TICKS定数Fixed 60 Hz ticks in the magnetic-block removal phase.
removeIds関数Remove the selected native cell indices and discard bonds whose endpoint gems were removed.
restartGame関数Restarts the same seed, custom starting board, fixed queue, rules and floor options.
Settings型Validated settings fixed at native game creation.
settle関数Settle surviving gems with the chosen floor rule and retain valid stable-id bonds.
statusOf関数Returns a compact immutable status including current and upcoming floor state.
Transition型The resulting native state, emitted events and acceptance decision; rejected actions preserve the input.
tutorialManifest定数Alias kept alongside other Houseki campaign lesson APIs.

ソースを見るGitHub で編集@johnmorrisdotca/houseki 0.4.2 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。