Jump to content

game.input.onTap debugging help.


Giuoco
 Share

Recommended Posts

Hello!  (first time post for me...)
 
I have inconsistent performance with onTap.  About 1 in 10 "taps" my player doesn't "jump".
 
How can I isolate if this is a physics problem, an event problem, or maybe a <div> blocking the tap?  I'm having a hard time debugging the intermittent problem since it only happens 1 out of 10 or 15 taps.   
 
in my create Function I have:

 

        game.input.onTap.add(this.onTapLvl1, this);

my onTapLvl1 callback is this:

  doubleJumpBool: false,    onTapLvl1: function (thisPlayer, doubleTap)     {        //check to make sure hoppy isn't hurt        if(this.player!=null)        {                        //check to see if hoppy is on the ground            if(this.player.body.touching.down)            {                this.jumpAudio.play();                this.doubleJumpBool = true;                this.player.body.velocity.y = -350;                                            }                        //check to see if we will allow a double jump            if(!this.player.body.touching.down && this.doubleJumpBool)            {                this.jumpAudio.play();                this.player.body.velocity.y += -200;                this.doubleJumpBool = false;            }        }    },
        
Thanks!
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...