Thanks, with casting to uint code works. But there is another problem. I have code
///create_collision_map(col_map, w, h) /* constants: blocks EMPTY = 0 BLOCK = 1 LADDER = 2 LADDER_TOP = 4 LADDER_WAT = 8 WATER = 16 ACID = 32 GATE = 64 LAMP = 128 */
var map = argument0; var w = argument1; var h = argument2;
for (var j = 0; j < h; j++) { for (var i = w - 1; i > -1; i--) { map[@ j, i] = 0;//error } }
var xpos, ypos, t, xx, yy, left, xpos;//, top, ypos, ind; var bgw = background_get_width(col_tiles) >> 6; //store all tiles in the array for (ypos = 0; ypos < room_height; ypos += BL_SIZE) { for (xpos = 0; xpos < room_width; xpos += BL_SIZE) { t = tile_layer_find(0, xpos, ypos); if (t > 0) { left = tile_get_left(t) >> 6; switch(left) { case 1: map[@ ypos >> 6, xpos >> 6] = BLOCK; break; case 2: map[@ ypos >> 6, xpos >> 6] = LADDER; break; case 3: map[@ ypos >> 6, xpos >> 6] = LADDER_TOP; break; case 4: map[@ ypos >> 6, xpos >> 6] = LADDER_WAT; break; case 5: map[@ ypos >> 6, xpos >> 6] = WATER; break; case 6: map[@ ypos >> 6, xpos >> 6] = ACID; break; case 7: { var lamp = array_create(5); lamp[L.x] = xpos; lamp[L.y] = ypos; lamp[L.spr] = get_lamp_sprite(); lamp[L.frm] = 0; lamp[L.spd] = random_range(0.05, 0.2); ds_list_add(g.lamplist, lamp); } break; } }//if t }//for xpos }//for ypos
tile_layer_delete(0);
} And there is an error: Syntax error in script 'create_collision_map' Line 19, position 13(absolute 386): Unexpected symbol '@': unknown to compiler
If I understand right, ENIGMA does not allow GML acessors for arrays, lists and so on.
|