Log inGet started
Package

scheme.module

Newest version

README.md

sideScrollerKit.scheme

The kit's control scheme, metroidvania: twoDKit's platformer controls (move, jump, dash, interact, crouch), slash2D's attack and a map button, on keyboard, gamepad and touch.

A world can hold several builds of controlsKit side by side, and each keeps its own schemes and its own active scheme. The player body reads input through twoDKit's build, the sword through slash2D's and the kit's prompts through the kit's own, so this module registers the scheme in all three and switches each to it.

  • Scheme.ensure() registers it in the kit's build and twoDKit's.
  • Scheme.use() switches the kit's build and slash2D's to it (cheap when nothing changed).
  • Scheme.read(action) reads an action through the kit's build (tests and debugging).

The Metroidvania component calls ensure once and use every frame; you only call these yourself in a scene without that component.