Jump to content

Using arcade distanceBetween


Go to solution Solved by Heppell08,

Recommended Posts

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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...