mp_grid_to_ds_grid

Copies the data from a motion planning grid to a pre-made DS grid.

Syntax:

mp_grid_to_ds_grid(source, destination);


Argument Description
source Index of the mp_grid that is to be used
destination Index of the ds_grid that is to be used to copy the grid data to.


Returns: Boolean.


Description

With this function you can copy the given MP grid into a DS Grid. The DS grid should be the same size as the MP grid, although it doesn't have to be (data will be lost if it is smaller, and if it is larger all extra grid cells will be 0). The DS grid cells will contain the value -1 if the MP grid cell was flagged as occupied, or it will be 0 if not.


Example:

motion_grid = ds_grid_create(room_width / 32, room_height / 32); mp_grid_to_ds_grid(mp_grid, motion_grid);

The above code will create a new DS grid and then copy the MP grid data contained in the variable "mp_grid" into the new DS grid.


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