Does anyone see an error in this code? LOVE doesn't say an error to me, but what it does is it doesn't work properly. This is my third topic on coding help
what this is supposed to do is build a grid using my images, fitting the size of the window perfectly. Without the color pieces added, it works fine. But, adding the changing one thing in the board table chanegs the entire row! It's laid out like this: A table containing other tables. When you press a button it checks to see if the the grid space is existent and empty. If so, it changes that value. In this code, it constantly draws that table, so if the table is changed, boom, it changes on the screen. I have the table change working, as said above. But, it changes the row, instead of one piece. If there is an error in this, then there's my problem. If not, I know where the problem is.
Code: Select all
function love.draw()
if not selected then
love.graphics.print("PLEASE SELECT A GRID SIZE 4-8", 200, 200)
else
for i=1, 8 do
row=board[i]
for l=1, 8 do
local piece=row[l]
if piece~=0 then
love.graphics.drawq(piece, grid, w*(i-1), he*(l-1), 0, 1, 1, 0, 0)
end
end
end
end
end