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

Catching the kill event


Fuzzy27
 Share

Recommended Posts

Hi ,  i am a newbie in using PhaserIO and i am looking for  a way to catch the kill event.

 

Use Case:  Spawning new objects when mininimum is reached.  

 

The objects die when lifespan is over and i do not get Info about that.

 

How can i do this?

 

 

 

        //  Create a star inside of the 'stars' group
        var star = stars.create(50 + i * distance, 0, 'star');
        nStarsAlive++;
 
        //  Let gravity do its thing
        star.body.gravity.y = 300;
        star.nStarsAlive
        star.lifespan = 20000;   // 10 Sekunden
 

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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