i have a vague idea of a game i want to make and i figured no better way to learn then by doing so i spent some time reading the wiki and started working adding features as i got the prior ones working but i just hit a point where as far as i understand what i did should work but it does not so there must be something i don't understand
this is where i think my problem is cause before i added it everything worked
Code: Select all
puzzle = { --builds a random puzzle into a table
for hight = 1, 8 do --i want my puzzle to have 8 horazontal rows
{ for width = 1, 12 do -- i need the { to begin each block of columns that will give me my rows and i want each row in my puzzle to have 12 vertical columns
math.random(#blockTypes) --i want to fill my puzzle with the same number of block types that i have image's loaded in the table blockTypes
if width ~= 12 then , end -- i need a , between each randomly assigned block for each new column in the row im building but not after the last one
} if hight ~=8 then , end -- i need the } to end the block of columns that i am building compleating a row and i nead a , between each new row but not after the last one
end -- im done building rows
} -- i close my table that holds my randomly filled puzzle
Error: Syntax error: main.lua:16: unexpected symbol near 'for'
stack traceback:
[C]: ?
[C]: in function 'require'
[string "boot.lua"]31: in function <[string "boot.lua"]:227>
[C]: in function 'xpcall'
attached is the .love both what i have that works and what i have that i don't understand why it doesn't work
any help you can give is appreciated