Jump to content

Timer Problem


royibernthal
 Share

Recommended Posts

I'm trying to add a new timer when my state is created (the code is reached for sure), and nothing happens:

 

this.bla = function()
{
alert("Finished");
}
 
var tr = new Phaser.Timer(game, false);
 
tr.add(this.bla, 100, this);
 
What am I doing wrong?
 
Also it'd be great if anyone could explain to me what's callback context and what might be its uses.
Link to comment
Share on other sites

Instead of doing a timer that way, try:

game.time.events.add(5000, this.bla, this);

I have that code in one of my Typescript projects and it works for me - the syntax should be the same.You don't need to call start() on it that way either.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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