local mapa = {}
function love.load()
for i=1, 26, 1 do --Gera aleatoriamente uma matriz 26 x 20
mapa[i] = {}
for j=1, 20, 1 do
mapa[i][j] = love.math.random(0, 3)
end
end
end
function love.draw()
for i=1, 26, 1 do
for j=1, 20, 1 do
--Percorre a matriz e desenha quadrados coloridos
if (mapa[i][j] == 0) then
love.graphics.setColor(255,0,0)
elseif (mapa[i][j] == 1) then
love.graphics.setColor(0,255,0)
elseif (mapa[i][j] == 2) then
love.graphics.setColor(0,0,255)
elseif (mapa[i][j] == 3) then
love.graphics.setColor(255,255,0)
end
love.graphics.rectangle("fill", (i * 30)-20, (j * 30)-30, 30, 30)
end
end
end