Rexzqy
Member
So i made a rough fleeing code for enemy:
in step event:
if fleeing = true
{
if alarm[4] = -1
{
alarm[4] = room_speed*0.25;
}
}
in alarm[4]:
if mp_grid_path(grid,path,x,y,obj_player.x,obj_player.y,true)
{
path_start(path, -0.5, path_action_stop, false);
}
i thought it would make them go to the opposite direction, but they just teleport right to the player object..Any idea why? Thanks in advance!!
in step event:
if fleeing = true
{
if alarm[4] = -1
{
alarm[4] = room_speed*0.25;
}
}
in alarm[4]:
if mp_grid_path(grid,path,x,y,obj_player.x,obj_player.y,true)
{
path_start(path, -0.5, path_action_stop, false);
}
i thought it would make them go to the opposite direction, but they just teleport right to the player object..Any idea why? Thanks in advance!!