mp_grid_destroy

Destroys the indicated mp_grid and frees up its memory.

Syntax:

mp_grid_destroy(id);


Argument Description
id Index of the mp_grid that is to be destroyed


Returns: N/A.


Description

You can use this function to destroy the indicated mp_grid and free up the memory allocated it. It is essential that you call this whenever the mp_grid is finished with or you could potentially get a memory leak, meaning that your game will slow down over time and eventually crash.

NOTE: Destroying an mp_grid when there are still instances using it will result in an error!


Example:

if timer = 0
   {
   mp_grid_destroy(grid);
   room_goto(rm_Menu);
   }

The above code will destroy the mp_grid indexed in the variable "grid" if the variable "timer" is equal to 0, and then goto another room.


Back: Motion Planning
Next: mp_grid_path
© Copyright YoYo Games Ltd. 2018 All Rights Reserved