Fuzzy27 Posted October 16, 2015 Share Posted October 16, 2015 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 More sharing options...
rich Posted October 18, 2015 Share Posted October 18, 2015 sprites.events.onKilled.add(yourFunction, functionContext); Tilde, MichaelD and shohan4556 3 Link to comment Share on other sites More sharing options...
Recommended Posts