Rexzqy
Member
Hi fellow game makers,
I want to write a code which teleports wolf object to their leader when too far away from the leader. I dont really want to teleport to the leader's exact position, maybe like in a circular area that has 150 radius. Something like If point_distance(x,y,leader.x,leader.y) > 400, then x = random_range(-75,75) and y = random_range(-75,75). But what is the best way to check for wall and if there's wall, then choose another coordinate? do i have to use the "do..until"? Will it lag the game if most of that 150 radius area is covered with wall?
Any help is greatly appreciated!!
I want to write a code which teleports wolf object to their leader when too far away from the leader. I dont really want to teleport to the leader's exact position, maybe like in a circular area that has 150 radius. Something like If point_distance(x,y,leader.x,leader.y) > 400, then x = random_range(-75,75) and y = random_range(-75,75). But what is the best way to check for wall and if there's wall, then choose another coordinate? do i have to use the "do..until"? Will it lag the game if most of that 150 radius area is covered with wall?
Any help is greatly appreciated!!