Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

On


ThatGirlDee
 Share

Recommended Posts

I'm trying to set a timer to remove the onDown callback if the onDown input is enabled for a certain amount of seconds.

 

At this stage I have a timer in the update function which should just print a word, but the timer never fires and the word is never printed. I feel like I have missed something simple but any help would be much appreciated.

 

 

 

 my timer looks like this

this.game.time.events.loop(delay, this.touchOff, this);  

 the function touchOff simply prints "TOUCH OFF" at the moment. 

Link to comment
Share on other sites

Your code is fine. What does 'delay' contain? Try replacing it with Phaser.Timer.SECOND and see what happens. The timer doesn't need starting because you're using the global Phaser Timer, so it must be something else going on. Either it never got a chance to start, or touchOff couldn't be accessed, or delay doesn't hold a ms value.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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