T
TRANEPRODUCTIONS
Guest
Hey im trying to create a rougelike game but i cannot for the life of me figure out whats going wrong in the process I've ran into this issue more then once so i decided to post it here.
I used to times the J position by the width to get sorta kinda were it should be on the string but it's not exactly correct can someone help please.? P.s The prefab's are stored in strings using a 8x5 box size for now.
dX & dY are the drill integers used to select what position it is in on the map the rest of the coding is finished but not relevant to this specific error.
I used to times the J position by the width to get sorta kinda were it should be on the string but it's not exactly correct can someone help please.? P.s The prefab's are stored in strings using a 8x5 box size for now.
dX & dY are the drill integers used to select what position it is in on the map the rest of the coding is finished but not relevant to this specific error.
Code:
roomPrefab[0] = "000000000s0000s0000000000s0000s000000000"
//Setup Prefab
for(j=0;j<roomPrefabHeight[roomType];j++){
for(o=0;o<roomPrefabWidth[roomType];o++){
var xx, yy;
xx = dX + (o*16);
yy = dY + (j*16);
var str = string_char_at(roomPrefab[roomType], (o+j*8));
show_debug_message(str);
if (str == "s"){
instance_create_depth(xx, yy, 0, ospawner);
}
//ADD Floor's
ds_grid_set_region(global.grid, xx, yy,xx+16, yy+16, 2);
}
}