+
Skip to content

Implement vibration support #23

@mrfatguy

Description

@mrfatguy

For testing purposes only (since no map is currently developed), implement gamepad's vibration when player reaches borders of the down:

https://copilot.microsoft.com/shares/Y1a5qxeDgZuT3ELK2GXd1#:~:text=Vibration%20Support%20in%20Phaser%203

const pad = this.input.gamepad.getPad(0);
if (pad && pad.vibration && pad.vibration.playEffect) {
  pad.vibration.playEffect('dual-rumble', {
    startDelay: 0,
    duration: 200,
    weakMagnitude: 0.5,
    strongMagnitude: 1.0
  });
}

This uses core Phaser 3 support for game controllers, not the Merged Input Plugin (#22).

This is broken in Firefox and not supported at all in Safari, so can be tested in Edge and Chrome only.

Metadata

Metadata

Assignees

Labels

uxUser experience, design, usability, and UI

Projects

Status

Backlog

Relationships

None yet

Development

No branches or pull requests

Issue actions

    点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载