Optionaloptions: InputPluginOptions<A, G>const ecs = ECSpresso.create()
.withPlugin(createInputPlugin({
actions: {
jump: { keys: [' ', 'ArrowUp'] },
shoot: { keys: ['z'], buttons: [0] },
},
}))
.build();
// In a system:
const input = ecs.getResource('inputState');
if (input.actions.justActivated('jump')) { ... }
if (input.keyboard.isDown('ArrowRight')) { ... }
Create an input plugin for ECSpresso.
This plugin provides: