Object pauses path, attacks and continues path

K

Kiuro

Guest
hi community,
I began with GameMaker ~one month ago so i am very inexperienced.

Currently I am working on a small tower defense game but sighted a small problem i cant get over:

I have the obj_enemy_unit and the obj_player_unit, both follow their own path (actually its the same, just reversed) if they cross or colide with each other I want them to stay and fight, the winner checks if there is another target in range, if not, he continues his path.

Any tips how i can get this to work?
 

Roderick

Member
Set up a collision event. When they collide, set their path_speed to 0. In the step event, check to see if there's an enemy nearby. If yes, tell them to fight it. If not, tell them to reset their path_speed to the original value.
 
K

Kiuro

Guest
@jo-thijs thanks, thats nearly it, the only difference is that i dont want them to follow each other.

@Roderick that sounds logic and simple to me, i will try it.
 
Top