UNPKG

gamekit-utils

Version:

Minimal, fast and useful utilities for randomness, array manipulation and math — built for games, UI logic and generative design.

10 lines (9 loc) 425 B
/** * Checks if the given phase is within the specified range in a cyclic manner. * @param from The start of the range (inclusive). * @param to The end of the range (exclusive). * @param phase The current phase to check. * @param cycle The length of the cycle. * @returns 1 if the phase is within the range, 0 otherwise. */ export declare function pulse(from: number, to: number, phase: number, cycle: number): 0 | 1;