frame

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Register

How do you find the distance between two objects?

I want to make it so enemies will spawn near the player in my game. I also want to make it so enemies only shoot when the player is near by but... How? I can easily find the X and Y of both the player and enemies in my game but how do you use those to find the distance? I can't use a distance formula but you can't use square roots in expressions. The proximity can only tell me the cords of the enemy when they get close to the ship. But that won't allow me to disable them from shooting or make a zone near the player that enemies won't spawn.

Comments

Sign In or Register to comment.

flowlab.io

| make games in your browser
@ 2017 Flowlab.io, All rights reserved.

Contact us

Get In Touch