Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local wce = require("WCE")
- local term = require("term")
- local forms = require("forms")
- local event = require("event")
- local buf = require("doubleBuffering")
- local component = require("component")
- gpu = component.gpu
- w, h = gpu.getResolution()
- ------functions-------
- local function exit()
- term.clear()
- os.exit()
- end
- local function startgame()
- term.clear()
- GameForm=forms.addForm()
- ButtonExitG=GameForm:addButton(w-10, h-1, "Exit", exit)
- GameForm.border=1
- forms.run(GameForm)
- for i=1,w do
- wce.PrintHere(i, h, "█")
- end
- -- buf.line(1, h-10, w, h-10, 0xa9a9a9, 0xa9a9ff, "█")
- buf.draw()
- end
- local function drawmenu()
- MenuForm=forms.addForm()
- MenuForm.border=1
- ButtonExit=MenuForm:addButton(w/2, h-10, "Exit", exit)
- ButtonStart=MenuForm:addButton(w/2, h-12, "Start", startgame)
- forms.run(MenuForm)
- end
- drawmenu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement