alestane icon

Multilayer world

alestane | PRO | 01/06/14 12:10:29 AM UTC | 0 ⭐ | 322 👁️ | Never ⏰ | []
Lua |

390 B

|

None

|

0 👍

/

0 👎

    local world = display.newGroup()
    group:insert(world)
    local movable = display.newGroup()
    group:insert(movable)
    for i=1, 8 do
        for j=1, 8 do
            local value = gameMap[i][j]
            if tileFactory[value] then
                local mobile
                gameMap[i][j], mobile = tileFactory[value](i, j)
                world:insert(gameMap[i][j])
                if mobile then
                    movable:insert(mobile)
                end
            end
        end
    end

Comments