alestane icon

Map creation (single loop)

alestane | PRO | 01/02/14 03:57:21 PM UTC | 0 ⭐ | 310 👁️ | Never ⏰ | []
Lua |

560 B

|

None

|

0 👍

/

0 👎

    for i=1, 8 do
        for j=1, 8 do
            if gameMap[i][j] == 1 then
                gameMap[i][j] = gameTile(i,j)
                group:insert(gameMap[i][j])
            elseif gameMap[i][j] == 0 then
                gameMap[i][j] = brickTile(i,j)
                group:insert(gameMap[i][j])
            elseif gameMap[i][j] == 2 then
                gameMap[i][j] = grassTile(i,j)
                group:insert(gameMap[i][j])
            elseif gameMap[i][j] == 3 then
                gameMap[i][j] = tileWithBox(i,j)
                group:insert(gameMap[i][j])
            elseif gameMap[i][j] == 4 then
                gameMap[i][j] = heroTile(i,j)
                group:insert(gameMap[i][j])
            end
        end
    end

Comments