Advertisement
alestane

Multilayer world

Jan 5th, 2014
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.39 KB | None | 0 0
  1.     local world = display.newGroup()
  2.     group:insert(world)
  3.     local movable = display.newGroup()
  4.     group:insert(movable)
  5.     for i=1, 8 do
  6.         for j=1, 8 do
  7.             local value = gameMap[i][j]
  8.             if tileFactory[value] then
  9.                 local mobile
  10.                 gameMap[i][j], mobile = tileFactory[value](i, j)
  11.                 world:insert(gameMap[i][j])
  12.                 if mobile then
  13.                     movable:insert(mobile)
  14.                 end
  15.             end
  16.         end
  17.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement