Advertisement
vacanickel

Untitled

Sep 4th, 2015
69
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. term.setTextColor(colors.lime)
  16. term.setCursorPos(21,5)
  17. term.clearLine()
  18. print(tamaEyes[1])
  19. term.setCursorPos(21,7)
  20. term.clearLine()
  21. print(happyTama[1])
  22. term.setCursorPos(21,8)
  23. term.clearLine()
  24. print(happyTama[2])
  25. term.setCursorPos(1,2)
  26. elseif health > 10 and health < 15 then
  27. --Meh
  28. term.setTextColor(colors.yellow)
  29. term.setCursorPos(21,5)
  30. term.clearLine()
  31. print(tamaEyes[1])
  32. term.setCursorPos(21,7)
  33. term.clearLine()
  34. print(mehTama[1])
  35. term.setCursorPos(21,8)
  36. term.clearLine()
  37. term.setCursorPos(1,2)
  38. elseif health > 5 and health < 10 then
  39. --Sad
  40. term.setTextColor(colors.orange)
  41. term.setCursorPos(21,5)
  42. term.clearLine()
  43. print(tamaEyes[1])
  44. term.setCursorPos(21,7)
  45. term.clearLine()
  46. print(sadTama[1])
  47. term.setCursorPos(21,8)
  48. term.clearLine()
  49. print(sadTama[2])
  50. term.setCursorPos(1,2)
  51. elseif health > 1 and health < 5 then
  52. --Mad
  53. term.setTextColor(colors.red)
  54. term.setCursorPos(21,5)
  55. term.clearLine()
  56. print(tamaEyes[3])
  57. term.setCursorPos(21,7)
  58. term.clearLine()
  59. print(sadTama[1])
  60. term.setCursorPos(21,8)
  61. term.clearLine()
  62. print(sadTama[2])
  63. term.setCursorPos(1,2)
  64. end
  65. print(string.rep("|",health))
  66. event,button=os.pullEvent("mouse_click")
  67. if sleep (500) then
  68. health = health - 1
  69. if button == 1 and health > 1 then
  70. health = health + 1
  71. term.setCursorPos(1,2)
  72. term.clearLine()
  73. print (\n \n\n\n\n\n\n Dodo?)
  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