Hi .
Fist of all , excuse me for my poor English .
Well , I am making a game . There is a player and 10 zombies . Now I want to make simple AI . When the player gets near to the zombies , they attack him . But I don't know how to make this !
In GM 8.0 , there was a function called : Distance-to-object()
But I couldn't find such a thing in Construct 2.0 .
I tried to use this code , but unfortunately , it didn't work <img src="smileys/smiley19.gif" border="0" align="middle" /> ... :
Event 2 : System : zombie.x <= player.x + 50
System : Zombie.y <= player.y +50
Action : blah blah blah
Event 1 : System : zombie.x >= player.x + 50
System : Zombie.y >= player.y +50
Action : blah blah blah
Well , I think this code didn't work because there are more than 1 zombie in the game , just guessing ...
Now , my questions :
1 . Why didn't the code work ?
2 . Is there any other way for doing this ?
Thanks for reading . <img src="smileys/smiley1.gif" border="0" align="middle" />