Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help,
read this .
SniX
Prole
Posts: 24 Joined: Mon Aug 26, 2013 10:18 am
Post
by SniX » Wed Feb 26, 2014 9:17 pm
So a quick one, for anyone who can help me,
Code: Select all
map1={}
for i = 1, 10 do
for h = 1, 10 do
map1[i][h] = 1
end
end
Why doesnt this work???
davisdude
Party member
Posts: 1154 Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina
Post
by davisdude » Wed Feb 26, 2014 9:23 pm
I would need to know the error message (if any), but here's a guess:
Code: Select all
map1={}
for i = 1, 10 do
map1[i] = {}
for h = 1, 10 do
map1[i][h] = 1
end
end
GitHub |
MLib - Math and shape intersections library |
Walt - Animation library |
Brady - Camera library with parallax scrolling |
Vim-love-docs - Help files and syntax coloring for Vim
Jasoco
Inner party member
Posts: 3726 Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:
Post
by Jasoco » Wed Feb 26, 2014 9:44 pm
Yes. That's correct. You weren't creating the nested table so it was trying to add to an item that's not a table itself.
Simple mistake.
SniX
Prole
Posts: 24 Joined: Mon Aug 26, 2013 10:18 am
Post
by SniX » Wed Feb 26, 2014 10:57 pm
Jasoco wrote: Yes. That's correct. You weren't creating the nested table so it was trying to add to an item that's not a table itself.
Simple mistake.
Thanks
Users browsing this forum: Ahrefs [Bot] , Google [Bot] and 6 guests