en ru

← Documentation · @trempel/slot@3.0.0

// собрано tools/docs.mjs из npm @trempel/slot@3.0.0 — не править руками

@trempel/slot

A slot on @trempel/kit: making a slot is making a viewer — a reskin, a source of rounds and a choreography as data; the game's code is wiring. The kit computes no wins, reels or return: the client plays round facts (a flat list of typed facts, docs/facts.md) that something else makes — a server, recorded fixtures, a function.

Use

import { createGame, loadChoreo } from '@trempel/kit';
import { SLOT_CONTRACT, SLOT_HEIR, SLOT_POPUPS, createSlot, fixtureSource } from '@trempel/slot';
import config from './slot.json';            // grid, lines, wilds, bets, bindings — data
import symbols from './skin/symbols.json';   // letters of the facts → art
const CHOREO = import.meta.glob<string>('./choreo/*.md', { eager: true, query: '?raw', import: 'default' }); // the presentation

const slot = createSlot({ config, symbols, source: fixtureSource(FIXTURES), choreo: loadChoreo(CHOREO) });
const game = await createGame({
  state: slot.state, components: slot.components, actions: slot.actions,
  screens: { slot: { base, heir: SLOT_HEIR, contract: SLOT_CONTRACT } },
  popups: { fsIntro: { base: fsIntroBase, ...SLOT_POPUPS.fsIntro }, fsOutro: { … }, bigwin: { … } },
  start: 'slot',
});
slot.attach(game);

The template templates/slot of the repository is a complete slot with lines on synthetic fixtures (3×3 and 5×3, expanding ×1 / ×2 wilds, free spins, big win levels) with two skins and a base choreography of the genre to start from.

Dependencies

package license why
pixi-reels ^3.1 MIT the reels
gsap (peer of pixi-reels) GSAP Standard "no charge" license pixi-reels animates its reels with it; this package does not import it — it drives pixi-reels' instance from the game loop
@trempel/kit, @trempel/scene, pixi.js (peers) MIT

gsap ships in a game's bundle with pixi-reels (its license comment carries its URLs — LIBRARY_URLS tells the kit's Playables gate they are text).

License

MIT © Denys Vynohradskyi