Skip to the content

Meikyuu迷宮

Generate seeded mazes and arrow puzzles, follow numbered levels, and play on flat grids or three-dimensional surfaces.

Meikyuu is the Japanese word 迷宮 for labyrinth. About the name

Contents

Reference

Playable boards

import { … } from "@johnmorrisdotca/meikyuu/play";

50.2 kB minified and gzipped, with everything it imports (measured with esbuild)

Meikyuu, played in a page: mountMeikyuu draws a maze, an arrow puzzle or a mixed one into any element and plays it by touch and mouse, with zoom and pan for big mazes, page left beside the board to scroll by, a tall maze that lies down on a wide screen, Undo, Restart, Hint, a celebration that respects prefers-reduced-motion, optional sounds, and the words in English and Japanese. A separate entry (@johnmorrisdotca/meikyuu/play), so a server never loads any of it.

Exports

NameKindWhat it is
createMeikyuuSoundsfunctionCreate the optional synthesized native sound player; sound playback is requested by host actions.
EDGEconstantHow near an edge of the box a line's end must be dragged to move the view, and the most the view moves in a frame there, in pixels.
EDGE_STEPconstantThe native viewport edge-pan step in pixels.
edgeNudgefunctionHow far to move the view in a frame for a finger at (px, py) of a box: the board moves the other way, toward the finger.
ensureMeikyuuPlayStylefunctionPut the style in the page once: in the document's head, or in the shadow root the host is in.
FIT_MODESconstantWhat a fit makes visible: both the whole board (default); width the board as wide as the box, which for a board taller than the box is the top of it with the rest to move down to; height the board as tall as the box, the left of it for a board wider than the box.
FitModetypeFit both dimensions, only the width, or only the height of a board.
fitViewfunctionThe view that shows the board as a mode says, with a margin of pad cells: centred where it fits, and at the top or left where it does not.
isFittedfunctionWhether the view is the board fitted, as the mode says.
keptViewfunctionA view kept where some of the board can be seen: its middle never leaves the area (with a margin).
MEIKYUU_GUTTERconstantThe page left beside the box, in pixels: the least, and the most the zoom-out widens it to.
MEIKYUU_GUTTER_MAXconstantThe maximum native viewport gutter in pixels.
MEIKYUU_ORIENTATIONSconstantWHICH WAY UP A MAZE IS LOOKED AT.
MEIKYUU_PLAY_STYLEconstantTHE STYLE a playable Meikyuu board wears (mountMeikyuu, <meikyuu-board>): the drawing's own (MEIKYUU_STYLE) and the board's box, its buttons, its lines of words and its tabs.
MEIKYUU_RESERVEconstantWhat a window is assumed to hold besides the box, in pixels: the page's header, and the board's buttons and lines of words.
MEIKYUU_SOUND_KINDSconstantTHE SOUNDS, made in the browser: short tones from the Web Audio API, one for each thing that happens (a step, drawing back, a key, an arrow bumping, an arrow flying off, an unlock, a solve, a loss).
MeikyuuEventDetailtypeWhat every event tells of the board.
MeikyuuMounttypeThe mounted flat maze, arrow or mixed board, its game/actions, view and cleanup handle.
MeikyuuMountOptionstypeNative puzzle/level/recipe, display, controls, sound, stones and event callbacks for a flat player.
MeikyuuOrientationtypeThe native portrait, landscape or automatic board orientation.
MeikyuuPuzzletypeWhat is being played.
MeikyuuSoundKindtypeOne native synthesized board sound.
MeikyuuSoundstypeNative synthesized sound playback and cleanup methods.
MOST_CELL_PIXELSconstantThe scales a view may have: the whole board fitted, to a cell this many pixels wide (at least a bit past the fit, so a small maze can still zoom).
mountMeikyuufunctionDraw a puzzle into host and play it.
pannedByfunctionThe view moved so that the board slides by (dx, dy) pixels under the box.
pointAtfunctionThe point of the board under a pixel of the box.
puzzleOffunctionThe puzzle a set of options names: a level of the package's lists, or a recipe given, or null.
scaleLimitsfunctionRead the minimum and maximum view scale for this viewport and gutter.
ViewtypeA BOARD LOOKED AT THROUGH A BOX, which may be zoomed in until a cell is as big as a thumb and moved about: the arithmetic of the view, without a page.
ViewBoxtypeHow a box of width by height pixels shows a board: the margin round it in cells, and how far in a view may go.
viewBoxOffunctionThe text of the viewBox attribute that shows the view.
visibleAreafunctionThe part of the board the view shows.
zoomedAboutfunctionThe view zoomed by factor about the pixel (px, py) of the box, which stays over the same spot of the board.

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/meikyuu 3.2.0.