Advertisement
Guest User

startup

a guest
May 10th, 2014
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.66 KB | None | 0 0
  1. --Displays the Intro Screen--
  2.  
  3. local w,h = term.getSize()
  4. local selectedItem = 1
  5. running = true
  6.  
  7. term.setBackgroundColor(colors.white)
  8. term.clear()
  9.  
  10. function exit()
  11.   running = false
  12.   term.setBackgroundColor(colors.black)
  13.   term.setTextColor(colors.white)
  14.   term.clear()
  15.   term.setCursorPos(1,1)
  16.   print("Thank you for playing")
  17.   return running
  18. end
  19.  
  20. function spop()
  21.   term.clear()
  22.   shell.run(shell.resolve(".").."singleplayer")
  23. end
  24.  
  25. function mpop()
  26.   term.clear()
  27.   shell.run(shell.resolve(".").."custom")
  28. end
  29.  
  30. function psop()
  31.   term.clear()
  32.   shell.run(shell.resolve(".").."stats")
  33. end
  34.  
  35. function main()
  36.   while running do
  37.     local event, button, X, Y = os.pullEvent()
  38.     if event == "mouse_click" then
  39.         if X >= w/2 - 6 and X <= w/2 + 6 and Y == 13 and button == 1 then
  40.             spop()
  41.         elseif X >= w/2 - 5 and X <= w/2 + 5 and Y == 14 and button == 1 then
  42.             mpop()
  43.         elseif X >= w/2 - 3 and X <= w/2 + 3 and Y == 15 and button == 1 then
  44.             psop()
  45.         elseif X >= w/2 - 2 and X <= w/2 + 2 and Y == 16 and button == 1 then
  46.             exit()
  47.         end
  48.     end
  49.   end
  50. end
  51.  
  52.  
  53. function drawBg()
  54.   bg = paintutils.loadImage(shell.resolve(".").."bgt")
  55.   paintutils.drawImage(bg, 1,1)
  56.   term.setCursorPos(w/2 - 7, 1)
  57.   term.setBackgroundColor(colors.white)
  58.   term.setTextColor(colors.black)
  59.   print("WORLD OF TANKS")
  60.   term.setCursorPos(w/2 - 9, 11)
  61.   print("Choose A Game Mode")
  62.   term.setCursorPos(w/2 - 6, 13) --Singleplayer
  63.   print("Singleplayer")
  64.   term.setCursorPos(w/2 - 5, 14) --Customize
  65.   print("Customize")
  66.   term.setCursorPos(w/2 - 3, 15) --Stats
  67.   print("Stats")
  68.   term.setCursorPos(w/2 - 2, 16) --Exit
  69.   print("Exit")
  70.   main()
  71. end
  72.  
  73. drawBg()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement