Advertisement
CaptainSpaceCat

Shit Simulator 2015

Aug 7th, 2015
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.30 KB | None | 0 0
  1. term.setBackgroundColor(colors.black)
  2. term.clear()
  3.  
  4. local dick = false
  5. function dickLick()
  6. while dick == true do
  7. lick()
  8. end
  9. end
  10.  
  11. function lick()
  12. return slurp
  13. end
  14.  
  15. --[[PLANRIGHTHERE --> click to spawn shitty shit
  16. <OBJECTIVES>
  17. *shit objects
  18. *piss objectives]]--
  19.  
  20.  
  21. local timers = {
  22.     gameTick = os.startTimer(.1)
  23. }
  24.  
  25. Shit = {
  26.     x = 0,
  27.     y = 0,
  28.     length = 0
  29. }
  30.  
  31. function Shit:new(x, y, length)
  32.     local titties = {x=x, y=y, length=length}
  33.     return titties
  34. end
  35.  
  36. local shitTab = {}
  37.  
  38. function eventHandler(events)
  39. --userinput
  40. if events[1] == "mouse_click" then
  41. shitTab[#shitTab+1] = Shit:new(events[3], events[4], math.random(1, 5))
  42. end
  43.  
  44.  
  45.  
  46. end
  47.  
  48. function updateGame()
  49. for i, v in pairs(shitTab) do
  50. v.y = v.y + 1
  51. end
  52. end
  53.  
  54. function updateScreen()
  55. for i, v in pairs(shitTab) do
  56. term.setBackgroundColor(colors.black)
  57. term.setCursorPos(v.x, v.y - 1)
  58. write(math.random(0, 1) == 1 and " " or "")
  59. term.setBackgroundColor(colors.brown)
  60. for n = 1, v.length do
  61. term.setCursorPos(v.x, v.y + n - 1)
  62. write(" ")
  63. end
  64. end
  65. end
  66.  
  67.  
  68. function loop()
  69. local events = {os.pullEvent()}
  70. if events[1] == "timer" then
  71. updateGame()
  72. updateScreen()
  73. if events[2] == timers.gameTick then
  74. timers.gameTick = os.startTimer(.1)
  75. end
  76. else
  77. eventHandler(events)
  78. end
  79. end
  80.  
  81. while true do loop(); end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement