Advertisement
vacanickel

Untitled

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