How can I make the enemies always walk towards "Player" and when they hit "Player" they'll attack.
And if I play two player, They'll go and attack the nearest character.
Please help, Thanks
Printable View
How can I make the enemies always walk towards "Player" and when they hit "Player" they'll attack.
And if I play two player, They'll go and attack the nearest character.
Please help, Thanks
* Distance between enemy and player < Distance("Advanced Direction Object", X("enemy"), Y("enemy"), X("player 2"), Y("player 2"))
--Look at 0, 0 of player
* Distance between enemy and player 2 < Distance("Advanced Direction Object", X("enemy"), Y("enemy"), X("player"), Y("player"))
--Look at 0, 0 of player 2
* Enemy overlaps player
OR
* Enemy overlaps player 2
-- Attack
How do I do the "Distance between" condition?
Advanced Direction Object :)
And where is that, I've checked the objects menu and conditions.
http://ext.neatwares.ath.cx/ext/Advanced_Direction_Object :)
Seriously, isn't there any other way?
Well if you set an enemy to ball movement you could have it always look in direction of player. Then when it collides with the player have it attack or whatever you want.Quote:
Originally Posted by PimeX
You could use the actual distance formual instead of the expression from the Advanced Direction Object. However that's more of a hassle, why don't you want to use the ADO?Quote:
Originally Posted by PimeX
I think it might be like this ...
Distance = Sqr((X("Item1")-X("Item2"))*(X("Item1")-X("Item2")) + (Y("Item1")-Y("Item2"))*(Y("Item1")-Y("Item2")))
Is there a 'square' for MMF? I mean 'squareroot' is Sqr in MMF?