erikwatson / Bramble

A little JS game engine for jamming on prototypes.
MIT License
0 stars 1 forks source link

Input Grouping/Mapping #39

Open erikwatson opened 3 years ago

erikwatson commented 3 years ago

Bramble should provide a way to set input mappings, so we can do things like define a bunch of inputs that we group as "Jump" or whatever.

Example - something like this? Not entirely convinced.

input.define('jump', [
  { key: keyboard.Z,     state: 'justDown' }, 
  { key: keyboard.X,     state: 'down' }, 
  { key: keyboard.SPACE, state: 'released' }, 
])

if (input.isFiring('jump')) {
  // ...
}