Configure keyboard inputs once for all scenes to use

I wouldn’t add keys continuously. It should be something like

this.keys = {
  up: [
    'UP',
    this.scene.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.UP),
    this.scene.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.W),
  ],
  // …
};
1 Like