Check if path is blocked [SOLVED]

L

Latch

Guest
Using mp_grid functions, how would you check if an area to the destination has been blocked off by the player? E.g Tower defense games and the player cages in the A.I.

Is there a built in function for this that I have missed or do I require something else?
 
A

Aura

Guest
http://docs.yoyogames.com/source/da... collisions/motion planning/mp_grid_path.html

The Manual entry on mp_grid_path() said:
With this function you can create a path that will navigate from a start point to a finish point using an mp_grid that you have previously defined, avoiding any obstacles that have already been added into the grid. The xstart and ystart arguments indicate the start of the path in room coordinates, while xgoal, ygoal arguments indicate the destination. You can also select either horizontal/vertical movement only, or allow full diagonal movements by specifying true in the allowdiag argument. The function returns either true (it succeeded in finding a path) or false (it failed) as well as setting the chosen path.
 
L

Latch

Guest
Oh, thank you, I missed this as I was looking for a specific function that checks if the path was blocked, I didn't think this sort of function would return true or false, looks like I'll have to start reading into each function a bit more XD.

Thanks again
 
Top