phaser 3 active pointer problem on mobile

0

I am trying to move my player by clicking on the right or on the left of the game, everything is fine on the computer, but when I try it on the mobile, it always moves to the right and, after many attempts, it starts to move to the left, it does not matter where you press (either left or right). this is my update function

if(game.input.activePointer.isDown)
{  if(game.input.mousePointer.x > 600 )
{
player.setVelocityX(160);
player.anims.play('right', true);
}   else if (game.input.mousePointer.x < 200 )
{
player.setVelocityX(-160);
player.anims.play('left', true);
}
} else {
player.setVelocityX(0);
player.anims.play('turn', true);
} 
    
asked by Aaleeciii 06.11.2018 в 04:56
source

0 answers