I'm using Phaser.io
I would like to use A,S,D,W keys. I know that you can use arrow keys like this:
create(){
...
gameState.cursors = this.input.keyboard.createCursorKeys();
}
update(){
if (gameState.cursors.left.isDown) {
gameState.player1.setVelocityX(-160);
} else if (gameState.cursors.right.isDown) {
gameState.player1.setVelocityX(160);
}
}
I tried to switch .left. for .A. and .right. for .D. but it doesn't work.
Any ideas?