Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local event = require("event")
- local component = require("component")
- local colors = require("colors")
- local gpu = component.gpu
- local resolutionx , resolutionyp = gpu.getResolution()
- local resolutiony = resolutionyp
- local a = ""
- local bouton = 73
- function top()
- gpu.setBackground(colors.blue,true)
- while resolutiony > resolutionyp - 3 do
- while resolutionx > 0 do
- a = a .. " "
- resolutionx = resolutionx -1
- end
- resolutionx = gpu.getResolution()
- print(a)
- a = ""
- resolutiony = resolutiony - 1
- end
- resolutionx = gpu.getResolution()
- end
- function main()
- while resolutiony > 0 do
- gpu.setBackground(colors.yellow,true)
- while resolutionx > 0 do
- a = a .. " "
- resolutionx = resolutionx - 1
- end
- resolutionx = gpu.getResolution()
- print(a)
- a = ""
- resolutiony = resolutiony - 1
- end
- end
- function couleur()
- local _,_,x,y = event.pull("touch")
- gpu.setBackground(colors.black,true)
- gpu.setForeground(colors.black,true)
- gpu.set(x,y,"X")
- end
- function palette()
- local _,_,x,y = event.pull("touch")
- if x >= 73 and y >= 24 then
- couleur()
- end
- end
- function button()
- while bouton < 80 do
- gpu.setBackground(colors.blue,true)
- gpu.setForeground(colors.blue,true)
- gpu.set(bouton,24," ")
- gpu.set(bouton,25," ")
- bouton = bouton +1
- gpu.setForeground(colors.white,true)
- gpu.set(73,24,"Palette")
- end
- bouton = 73
- end
- while true do
- top()
- main()
- button()
- couleur()
- gpu.setBackground(colors.blue,true)
- gpu.setForeground(colors.white,true)
- gpu.set(2,2,"Bienvenue dans le paint de willem")
- -- palette()
- end
Advertisement
Add Comment
Please, Sign In to add comment