Advertisement
alestane

Map creation (multiple loops)

Jan 2nd, 2014
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.97 KB | None | 0 0
  1.     for i=1, 8 do
  2.  
  3.             for j=1, 8 do
  4.                 if gameMap[i][j] == 1 then
  5.  
  6.                     gameMap[i][j] = gameTile(i,j)
  7.                     group:insert(gameMap[i][j])
  8.                 end
  9.             end
  10.     end
  11.     --gumawa ka ng pader baby!
  12.  
  13.     for i=1, 8 do
  14.  
  15.             for j=1, 8 do
  16.                 if gameMap[i][j] == 0 then
  17.  
  18.                     gameMap[i][j] = brickTile(i,j)
  19.                     group:insert(gameMap[i][j])
  20.                 end
  21.             end
  22.     end
  23.  
  24.     --gumawa ka ng grass tiles
  25.     for i=1, 8 do
  26.  
  27.             for j=1, 8 do
  28.                 if gameMap[i][j] == 2 then
  29.  
  30.                     gameMap[i][j] = grassTile(i,j)
  31.                     group:insert(gameMap[i][j])
  32.                 end
  33.             end
  34.     end
  35. -- [[ gawin ang tiles plus yong box
  36.     for i=1, 8 do
  37.         --  tileBlox[i] = {}
  38.             for j=1, 8 do
  39.                 if gameMap[i][j] == 3 then
  40.  
  41.                     gameMap[i][j] = tileWithBox(i,j)
  42.                     group:insert(gameMap[i][j])
  43.                 end
  44.             end
  45.     end
  46.     --lagyan ng tiles at hero na din
  47.     for i=1, 8 do
  48.             heroBlox[i] = {}
  49.             for j=1, 8 do
  50.                 if gameMap[i][j] == 4 then
  51.                     gameMap[i][j] = heroTile(i,j)
  52.                     group:insert(gameMap[i][j])
  53.                 end
  54.             end
  55.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement