WASD keyboard movement (Phaser 3)

1 Like

There are two ways you can use addKeys():

var keys = this.input.keyboard.addKeys("W,A,S,D");
//-> { W: Key, A: Key, … }
var keys = this.input.keyboard.addKeys({ up: 'W', left: 'A', down: 'S', right: 'D' });
//-> { up: Key, left: Key, … }