Log In  


So, I'm making a game as a birthday present for my friend. As I always do, I forgot to do it before and am sitting here on the day before. Now, this game is tile based, and I need to mass generate some tiles which do the same thing with different values. Here is a simplified version of this problem:

for v,i in ipairs({33,34,35,36})do
  tiles[i]=function(mx,my)
    plr.d=v-1
    plr.g=true
  end
end

My question is, will this work, and if not, how would I go around doing this?



Nevermind. I stopped being lazy and actually tried it out, and it works.



[Please log in to post a comment]