Advertisement
Guest User

project.lua

a guest
Mar 23rd, 2016
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 KB | None | 0 0
  1. local wce = require("WCE")
  2. local term = require("term")
  3. local forms = require("forms")
  4. local event = require("event")
  5. local buf = require("doubleBuffering")
  6. local component = require("component")
  7. gpu = component.gpu
  8.  
  9. w, h = gpu.getResolution()
  10. ------functions-------
  11. local function exit()
  12. term.clear()
  13. os.exit()
  14. end
  15. local function startgame()
  16.   term.clear()
  17.   GameForm=forms.addForm()
  18.   ButtonExitG=GameForm:addButton(w-10, h-1, "Exit", exit)
  19.   GameForm.border=1
  20.   forms.run(GameForm)
  21.   for i=1,w do
  22.     wce.PrintHere(i, h, "█")
  23.   end
  24.  -- buf.line(1, h-10, w, h-10, 0xa9a9a9, 0xa9a9ff, "█")
  25.   buf.draw()
  26. end
  27. local function drawmenu()
  28.   MenuForm=forms.addForm()
  29.   MenuForm.border=1
  30.   ButtonExit=MenuForm:addButton(w/2, h-10, "Exit", exit)
  31.   ButtonStart=MenuForm:addButton(w/2, h-12, "Start", startgame)
  32.   forms.run(MenuForm)
  33. end
  34.  
  35. drawmenu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement