W
whale_cancer
Guest
I am debugging and noticed marked solid tiles were not being displayed as solid when drawing the mp_grid (i.e. all cells are green). I am quite certain global.tile_collision is working as my debugging message indicate the tile_collision coordinates are indeed being marked as either 0 or 1 depending on what mode my brush is in.
Thus, I think it is something here, in my draw code. I know this is inefficient, but this is just for debugging and my actual mp_grids when in-game will be handled elsewhere.
Anybody know why this is happening?
Thus, I think it is something here, in my draw code. I know this is inefficient, but this is just for debugging and my actual mp_grids when in-game will be handled elsewhere.
Anybody know why this is happening?
Code:
///Draw Collision
if (global.brush_mode == 'Mark Solid') || (global.brush_mode == 'Mark Free')
{
t_mpG = mp_grid_create(0, 0, global.mapWidth * 16, global.mapHeight * 15, 16, 16);
for (h = 0; h < global.mapHeight * 15; h += 1)
{
for (w = 0; w < global.mapWidth * 16; w += 1)
{
if ds_grid_get(global.tile_collision, w, h)
{
mp_grid_add_cell(t_mpG, global.mapWidth * 16, global.mapHeight * 15);
}
}
}
draw_set_alpha(0.25)
mp_grid_draw(t_mpG);
draw_set_alpha(1);
mp_grid_destroy(t_mpG);
}