Search found 223 matches

by KayleMaster
Tue Aug 30, 2016 10:50 am
Forum: Support and Development
Topic: Local variables and global variables
Replies: 40
Views: 12846

Local variables and global variables

I often notice when somebody asks a question for love2d and supplies code, the one who answers that with the new code always changes the global variables to local. For example: function love.load() --Version, title and window information version = 0.001; width, height, flags = love.window.getMode();...
by KayleMaster
Tue Aug 30, 2016 10:46 am
Forum: Support and Development
Topic: Multidimensional array returns nil.
Replies: 8
Views: 2470

Re: Multidimensional array returns nil.

Oops, forgot about the topic! I actually fixed it, I don't know how, but here's the current code: terrain_chunk = {} for y = 0,cols do local row = {} for x = 0,rows do row[x]=love.math.random(8); end terrain_chunk[y]=row; end
by KayleMaster
Mon Aug 29, 2016 8:56 am
Forum: Support and Development
Topic: Multidimensional array returns nil.
Replies: 8
Views: 2470

Multidimensional array returns nil.

terrain_chunk = {} for i=chunk_width,1,-1 do terrain_chunk[i] = {} for j=chunk_height,1,-1 do terrain_chunk[i][j] = 1 end end Code is located in love.load I followed a tutorial on the love website which I can't seem to find anymore for some reason :| It was called matrices and multidimensional arra...