A
Alan Fuller
Guest
Hey all. Pretty basic question here. I'm making a zombie video game and the mobs move off of the motion planning functions listed below.
grid = mp_grid_create(0, 0, room_width/16, room_height/16, 16, 16);
path = path_add();
mp_grid_add_instances(path, obj_wall, false);
mp_grid_path(grid, path, x, y, obj_player.x, obj_player.y, true);
path_start(path, spd, "", 0);
This is in the step of event of the zombie object. My question is this. The zombies get stuck on one another and then they can't move, so I was going to try to and another mp_grid_add_instances that would make zombies avoid other zombies. The line of code would probably look like this.
mp_grid_add_instances(path, obj_zombie, false);
If I do this though, the zombies don't move at all. I think the problem is that the zombie are trying to avoid themselves. Is there any way I can make each zombie only reference the other zombies?
Thanks.
grid = mp_grid_create(0, 0, room_width/16, room_height/16, 16, 16);
path = path_add();
mp_grid_add_instances(path, obj_wall, false);
mp_grid_path(grid, path, x, y, obj_player.x, obj_player.y, true);
path_start(path, spd, "", 0);
This is in the step of event of the zombie object. My question is this. The zombies get stuck on one another and then they can't move, so I was going to try to and another mp_grid_add_instances that would make zombies avoid other zombies. The line of code would probably look like this.
mp_grid_add_instances(path, obj_zombie, false);
If I do this though, the zombies don't move at all. I think the problem is that the zombie are trying to avoid themselves. Is there any way I can make each zombie only reference the other zombies?
Thanks.