Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- io.stdout:setvbuf('no')
- local L
- local H
- local tableau = {}
- local brique = {}
- math.randomseed(love.timer.getTime())
- function love.load ()
- L=love.graphics.getWidth()
- H=love.graphics.getHeight()
- briqueL=L/16
- briqueH=H/15
- for l=1,15 do
- tableau[l]={}
- for c=1,16 do
- tableau[l][c] = 1
- end
- end
- end
- function love.update(dt)
- end
- function love.draw()
- local briqueX,briqueY = 0,0
- for l=1,15 do
- briqueX=0
- for c=1,16 do
- if tableau[l][c] == 1 then
- ----------------------------couleur random---------------
- local r = math.random(1,255)
- local g = math.random(1,255)
- local b = math.random(1,255)
- love.graphics.setColor(r,g,b)
- -----------------------------------------------------------
- love.graphics.rectangle("fill",briqueX+1,briqueY+1,briqueL-2,briqueH-2)
- end
- briqueX=briqueX+briqueL
- end
- briqueY=briqueY+briqueH
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement