O
OneExalted
Guest
Hi everyone!
I'm making my first game right now (a top-down zombie survival) and it's going pretty good but I have an issue noone can seem to answer.
My zombies will clump together in one small space and it makes it far too easy for the player to kill them.
Their movement code is very simple
/// Zombie Movement
image_angle = direction
speed = 3
if instance_exists(oPlayer) {
direction = point_direction(x,y,oPlayer.x,oPlayer.y)
}
else {
direction = point_direction(x,y,oCorpse.x,oCorpse.y)
}
What I specifically want them to do is to always move towards the player but not overlap. People have suggested doing a collision event with xprevious and yprevious. But that makes them stop and I want them to just move around eachother to almost form a big wave around the player.
Does gml have an easy way to do this? People have also suggested place_free but I don't really understand how to use it to achieve what I want. Any help would be great. Thanks!
I'm making my first game right now (a top-down zombie survival) and it's going pretty good but I have an issue noone can seem to answer.
My zombies will clump together in one small space and it makes it far too easy for the player to kill them.
Their movement code is very simple
/// Zombie Movement
image_angle = direction
speed = 3
if instance_exists(oPlayer) {
direction = point_direction(x,y,oPlayer.x,oPlayer.y)
}
else {
direction = point_direction(x,y,oCorpse.x,oCorpse.y)
}
What I specifically want them to do is to always move towards the player but not overlap. People have suggested doing a collision event with xprevious and yprevious. But that makes them stop and I want them to just move around eachother to almost form a big wave around the player.
Does gml have an easy way to do this? People have also suggested place_free but I don't really understand how to use it to achieve what I want. Any help would be great. Thanks!