For some reason two finger taps are not being detected when I tap my fingers at the exact same time but they are detected when there is a bit of a delay. This is how I’m doing it:
create:
this.input.on('pointerdown', ptrDown);
this.input.on('pointerup', ptrUp);
update:
if((right && left && player.body.blocked.down) || (left && right && player.body.blocked.down))
player.setVelocityY(-500); //Double tap not always executing this line
else if(!left && right)
player.setVelocityX(100);
else if(!right && left)
player.setVelocityX(-100);
else if(!right && !left)
player.setVelocityX(0);
ptrDown:
if(pointer.worldX > width/2)
{
right = true;
}
if(pointer.worldX < width/2)
{
left = true;
}
ptrUp:
if(pointer.worldX > width/2)
{
right = false;
}
if(pointer.worldX < width/2)
{
left = false;
}