Javascript 如何在手机中左右移动播放机(Phaser 3)
我用的是Phaser3。如何在mobile中左右移动播放机Javascript 如何在手机中左右移动播放机(Phaser 3),javascript,phaser-framework,Javascript,Phaser Framework,我用的是Phaser3。如何在mobile中左右移动播放机 // This is the Keyboard left and right logic if (this.cursors.left.isDown && !touchingDown) { this.player.setVelocityX(-200); } else if (this.cursors.right.isDown && !touchingDown) { this.player.s
// This is the Keyboard left and right logic
if (this.cursors.left.isDown && !touchingDown) {
this.player.setVelocityX(-200);
} else if (this.cursors.right.isDown && !touchingDown) {
this.player.setVelocityX(200);
} else {
// stop Movement if <- & -> not working /
this.player.setVelocityX(0);
}
//这是键盘的左右逻辑
如果(this.cursors.left.isDown&&!触地){
this.player.setVelocityX(-200);
}否则如果(this.cursors.right.isDown&!触地){
this.player.setVelocityX(200);
}否则{
//如果不工作,请停止移动/
this.player.setVelocityX(0);
}
但我想在手机上使用触摸左右移动它
这是否回答了您的问题?