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

edgeNudgefunction

How 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. It is gentle: nothing at EDGE pixels from a side, rising in a line to EDGE_STEP pixels a frame at the side itself, so a finger that only brushes the edge of the box moves the view hardly at all, and one held at the very edge moves it steadily.

Import it

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

Definition

function edgeNudge(px: number, py: number, width: number, height: number): { dx: number; dy: number; }

Parameters

NameTypeDescription
pxnumber

The horizontal pointer position in viewport pixels.

pynumber

The vertical pointer position in viewport pixels.

widthnumber

The native width in cells or pixels specified by this signature.

heightnumber

The native height in cells or pixels specified by this signature.

Returns

{ dx: number; dy: number; }

How 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. It is gentle: nothing at EDGE pixels from a side, rising in a line to EDGE_STEP pixels a frame at the side itself, so a finger that only brushes the edge of the box moves the view hardly at all, and one held at the very edge moves it steadily.

Examples

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

console.log(edgeNudge(5,100,390,844));
{ dx: 6.204545454545454, dy: 0 }

What it prints (run when this page was built)

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