Advertisement
vacanickel

Untitled

Sep 4th, 2015
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. local w,h = term.getSize()
  2. local health = 20
  3. local happyTama = {"O O", " O O ", " O O ", " OOO "}
  4. local mehTama = {"O O", " O O ", " O O ", " OOO "}
  5. local sadTama = {"O O", " O O ", " O O ", " OOO "}
  6. local madTama = {"O O", " O O ", " O O ", " OOO "}
  7. local tamaEyes = {" O O "," X X "," v v "}
  8.  
  9. term.clear()
  10. term.setCursorPos(1,1)
  11. print("Health:")
  12. while true do
  13. if health > 15 then
  14. --Happy
  15. print("\n\n\n\n\n\n\n Dodo?")
  16. term.setTextColor(colors.lime)
  17. term.setCursorPos(21,5)
  18. term.clearLine()
  19. print(tamaEyes[1])
  20. term.setCursorPos(21,7)
  21. term.clearLine()
  22. print(happyTama[1])
  23. term.setCursorPos(21,8)
  24. term.clearLine()
  25. print(happyTama[2])
  26. term.setCursorPos(1,2)
  27. elseif health > 10 and health < 15 then
  28. --Meh
  29. term.setTextColor(colors.yellow)
  30. term.setCursorPos(21,5)
  31. term.clearLine()
  32. print(tamaEyes[1])
  33. term.setCursorPos(21,7)
  34. term.clearLine()
  35. print(mehTama[1])
  36. term.setCursorPos(21,8)
  37. term.clearLine()
  38. term.setCursorPos(1,2)
  39. elseif health > 5 and health < 10 then
  40. --Sad
  41. term.setTextColor(colors.orange)
  42. term.setCursorPos(21,5)
  43. term.clearLine()
  44. print(tamaEyes[1])
  45. term.setCursorPos(21,7)
  46. term.clearLine()
  47. print(sadTama[1])
  48. term.setCursorPos(21,8)
  49. term.clearLine()
  50. print(sadTama[2])
  51. term.setCursorPos(1,2)
  52. elseif health > 1 and health < 5 then
  53. --Mad
  54. term.setTextColor(colors.red)
  55. term.setCursorPos(21,5)
  56. term.clearLine()
  57. print(tamaEyes[3])
  58. term.setCursorPos(21,7)
  59. term.clearLine()
  60. print(sadTama[1])
  61. term.setCursorPos(21,8)
  62. term.clearLine()
  63. print(sadTama[2])
  64. term.setCursorPos(1,2)
  65. end
  66. print(string.rep("|",health))
  67. event,button=os.pullEvent("mouse_click")
  68. if sleep (500) then
  69. health = health - 1
  70. if button == 1 and health > 1 then
  71. health = health + 1
  72. term.setCursorPos(1,2)
  73. term.clearLine()
  74. else
  75. --Dead
  76. term.setCursorPos(21,5)
  77. term.clearLine()
  78. print(tamaEyes[2])
  79. term.setCursorPos(21,7)
  80. term.clearLine()
  81. print(mehTama[1])
  82. term.setCursorPos(21,8)
  83. term.clearLine()
  84. sleep(3)
  85. term.clear()
  86. term.setCursorPos(1,1)
  87. break
  88. end
  89. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement