Hello, i would like some help with a problem i still learning so i will appreciate any help ty very much.
The problem is on this code:
if matchlist ~= nil then for i = 1, #matchlist do print('lista:'..#matchlist) print('size:'..matchlist[i].tamanho) print('X ultimo:'..matchlist[i].x) end end for i = 1, #matchlist do print('lista2:'..#matchlist) print('size2:'..matchlist[i].tamanho) print('X ultimo2:'..matchlist[i].x) end if tilelist ~= nil then tilelist = sc.RemoveCluster(tilelist,matchlist) -- inside this function end
follows the function code:
function \_sc.RemoveCluster(tilelist,matchlist) for j = #matchlist,1,-1 do print('matchlistx:'..matchlist[j].x..','..matchlist[j].y..',')--..matchlist[j].tamanho) for i = #tilelist, 1, -1 do --print('tile x:'..tile[i].x) if tilelist[i].x == matchlist[j].x\*64 and tilelist[i].y == matchlist[j].y\*64 then print("removed:"..tilelist[i].tipo ..'i'..i) display.remove(tilelist[i]) tilelist[i] = nil end end end return tilelist, matchlist end
I tried change but i could not properly understand the data flow, sometimes i feels there’s a problem with transferring data on corona (of course is not the problem is on me) but the codes that works on love2d don’t work here and is something always of getting a nil value.
any chance of someone explain why here i get so many “nil value” problem and on love2d i dint get … since both are LUA script?
I’m going in circles all the time.