before bothering the board i have googled and also look at stackoverflow site.
i don't understand why my local add var is not incrementing during my for loop.
can someone give me an advice on what goes wrong?
i also tried with pairs but the result is the same .
so all value are 10 inside the array instead of 10,20,30...and so on.
Code: Select all
function love.load()
an_array={{0},{0},{0},{0},{0},{0},{0},{0}}
put_value_in()
end
function love.draw()
for b = 1,8 do
printinfo(an_array[1][1],30*b,10)
end
end
function printinfo(text,x,y)
love.graphics.print(text,x,y)
end
function put_value_in()
local add = 10
for i =1,8 do
an_array[i][1]= add
add = add+10
end
end
sorry for my noobism.