D3thy Posted May 25, 2014 Share Posted May 25, 2014 I'm trying to use game.physics.arcade.distanceBetween(player, robots); to test the distance between my player and the enemy robots, if within a specific range then have the enemy shoot at the player. I have a function for the enemy to fire, i'm just not sure how to set up the code that uses distance between to check the range, and then run the enemyFire function. Link to comment Share on other sites More sharing options...
Heppell08 Posted May 25, 2014 Share Posted May 25, 2014 if(game.physics.arcade.distanceBetween(player, robots) > 30){ // do something here } lobsterhands 1 Link to comment Share on other sites More sharing options...
D3thy Posted May 26, 2014 Author Share Posted May 26, 2014 Thank you very much Heppell08 Heppell08 1 Link to comment Share on other sites More sharing options...
Recommended Posts