Finding distance between two objects?

For questions about using Classic.

Post » Sun Feb 19, 2012 7:10 pm

Hey there, I want to find the distance between two objects, and use that distance so that if its less than a certain amount, a certain something will happen.

Also, How would I create this, at the moment I have a zombie, and if it has LOS to the Player, it will set a waypoint at the players position. However this causes the zombie to move to the players last position, and makes the game easy to play. I want to have it so that the zombie will always move towards the players current position, and not going to its last waypoint before doing so.mogey2012-02-19 19:15:22
B
4
G
1
Posts: 50
Reputation: 652

Post » Sun Feb 19, 2012 7:46 pm

Distance(Object1.x,Object1.y,Object2.x,Object2.y) Will give you the distance between 2 objects.

Could you not simply update the Zombie's waypoint every second or so as your player is moving?
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Sun Feb 19, 2012 10:19 pm

Even when I do that, the zombie still has to go to the past waypoint before it chooses to create another at the player. Previous waypoints are not overwritten by new ones.
B
4
G
1
Posts: 50
Reputation: 652


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests