Creating Matrices with a Loop
Posted: Wed May 16, 2012 3:31 am
I've done it before, just not with Love. What is wrong with my code?
It keeps telling me to stop indexing nil values, smh....
Code: Select all
function love.load()
Tiles = {}
for i = 1, XWindow/10 do
for q = 1, YWindow/10 do
Tiles[i][q][1] = math.random(1, 255-i)
Tiles[i][q][2] = math.random(1, 255-q)
Tiles[i][q][3] = math.random(1, 255-q/i)
end
end
end