You are not logged in.
Pages: 1
Thanks for the welcome!
The size of the grid "from the room size" did not come out intentionally for me - this was relevant only for my situation (now I understand that it was worth passing the dimensions of the grid to the function from the outside, and not expect everyone to have the same room size).
Using it, I came to the conclusion that it is not optimized enough - its execution for large mp_grids (the size of a room) takes too long.
Therefore, today I would recommend using it only for small grids.
I took a different path: I entered the coordinates information into the ds_list, and then created a filled cell in these coordinates (in mp_grid). All this turned out to be not universal, so I do not send another function.
Thanks for your site!
There is a function for copying a regular grid, but it is not suitable for mp_grid.
///@function mp_grid_copy(id,source);
///@description Copies one mp_grid to another mp_grid
///@param {real} id object_index
///@param {real} source object_index
{
var my_mp_grid_id=argument[0];
var other_mp_grid_id=argument[1];
mp_grid_clear_all(my_mp_grid_id);
for (var ix = 0; ix <= room_width; ix++;)
{
for (var iy = 0; iy <= room_height; iy++;)
{
if mp_grid_get_cell(other_mp_grid_id, ix , iy)=-1 mp_grid_add_cell(my_mp_grid_id, ix , iy);
}
}
}
Pages: 1