Jump to content

game.input.onTap debugging help.


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;            }        }    },
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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