Kii Posted August 22, 2018 Share Posted August 22, 2018 Hi, I'm a beginner web developer, I'm creating my first game using Phaser 3. I'm encountering a problem with the Enemies, I want to my enemies to change from safe to unsafe (Which I've managed to) but I want a random number of enemies to go from safe to unsafe at a time. How do I go about doing that? Link to comment Share on other sites More sharing options...
prob Posted August 23, 2018 Share Posted August 23, 2018 You can use Phaser.Math.Between, which is just a wrapper for the preferred method for choosing a random number in JS: Math.floor(Math.random() * (max - min + 1) + min); Link to comment Share on other sites More sharing options...
Recommended Posts