M
Midastouch
Guest
Hello everyone,
I want to put my spr_ground on each grid with a value = 1
I tried lot of things but i failed everytime, i need some help.
I think i am near to succed with the code bellow placed in my step event :
I want to put my spr_ground on each grid with a value = 1
I tried lot of things but i failed everytime, i need some help.
I think i am near to succed with the code bellow placed in my step event :
GML:
var a, b;
a = 0;
b = 0;
repeat (ds_grid_width(grid_))//check in each lines
{
repeat (ds_grid_height(grid_))//check in each columns
{
var value = ds_grid_get(grid_, a, b);//check the value in the grid
if value = 1 {draw_sprite(spr_ground,1,a*32,b*32)}//check if my value is 1 to draw sprite
b += 1;
}
b = 0;
a += 1;
}