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?

P#90116 2021-04-07 09:51

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

P#90124 2021-04-07 13:42

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-29 07:35:22 | 0.005s | Q:10