Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在手机中左右移动播放机(Phaser 3)_Javascript_Phaser Framework - Fatal编程技术网

Javascript 如何在手机中左右移动播放机(Phaser 3)

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

我用的是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.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);
}
但我想在手机上使用触摸左右移动它


这是否回答了您的问题?