SkyOffice icon indicating copy to clipboard operation
SkyOffice copied to clipboard

Change arrow control to wasd

Open JimmyNi opened this issue 2 years ago • 0 comments

I would like to keep the arrow control and add WASD control but failed. I change the code in Game.ts file in line 42 this.cursors = this.input.keyboard.createCursorKeys() to

this.cursors = this.input.keyboard.addKeys(
      {up:Phaser.Input.Keyboard.KeyCodes.W,
      down:Phaser.Input.Keyboard.KeyCodes.S,
      left:Phaser.Input.Keyboard.KeyCodes.A,
      right:Phaser.Input.Keyboard.KeyCodes.D,
      space:Phaser.Input.Keyboard.KeyCodes.SPACE,
      shift:Phaser.Input.Keyboard.KeyCodes.SHIFT
    });

Then I got error Type {} is missing the following properties from type 'CursorKeys': up, down, left, right, and 2 more.ts(2740) I have no idea why I got this error, can someone pls help out?

JimmyNi avatar May 18 '22 14:05 JimmyNi