Advertisement
xXm0dzXx

FlameWars v1

Oct 8th, 2012
296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.15 KB | None | 0 0
  1. --welcum to dah gaym cawld flame wars
  2. --in flawm warz, you r dah roflcoptah in dah plaic wit
  3. --peepl skidiven an u haz roflcoptah bullet dat go pew
  4. --pew an u shoot dem innocent skydivzerz dat r falzing
  5. --or u can go below dem and dey fawll into der bladez,
  6. --den dey get chopper upped andz u get pointz
  7. --
  8. --enjoi playin!
  9.  
  10. local heliPosition = 4
  11. local helicopter1 = [[
  12. L
  13. O             :LOL:ROFL:ROFL:
  14. L\\        _____I____
  15.    =========    |  |[\
  16.            \____o==___)
  17.           ___I_I__/
  18. ]]
  19. local helicopter2 = [[
  20.  
  21. LOL  ROFL:ROFL:LOL:
  22.  \\        _____I____
  23.    =========    |  |[\
  24.            \____o==___)
  25.           ___I_I__/
  26. ]]
  27.  
  28. local enemy = [[
  29.  ___
  30. (   )
  31.  \o/
  32.   |
  33.  / \
  34. ]]
  35.  
  36. local background1 = "                                                                                     __________                                        "
  37. local background2 = "              _______              ______________                                   /          \\                                       "
  38. local background3 = "         ____/       \\        ____/___________   \\      __         ________       _/   ___      \\________              __________      "
  39. local background4 = "________/             \\______/                \\___\\____/  \\_______/        \\_____/    /   \\              \\____________/          \\_____"
  40.  
  41.  
  42. local bullet = "-"
  43. local helicopter = 1
  44. local kills = 1
  45. local scroll = 1
  46. local x,y = term.getSize()
  47. local bulletX = {}
  48. local bulletY = {}
  49. local enemies = {}
  50.  
  51. heliSpin = os.startTimer(0.6)
  52. heliBullet = os.startTimer(0.5)
  53. while true do
  54.     levelString = "Points: " ..kills.. " "
  55.     term.clear()
  56.     term.setCursorPos(scroll, y-4)
  57.     print(string.sub(background1, scroll, x+scroll-2))
  58.     print(string.sub(background2, scroll, x+scroll-2))
  59.     print(string.sub(background3, scroll, x+scroll-2))
  60.     print(string.sub(background4, scroll, x+scroll-2))
  61.     for i=1,#bulletX do
  62.         term.setCursorPos(bulletX[i], bulletY[i])
  63.         write(bullet)
  64.     end
  65.     term.setCursorPos(x-#levelString, 1)
  66.     write(levelString)
  67.     term.setCursorPos(1, heliPosition)
  68.     if helicopter == 1 then
  69.         print(helicopter1)
  70.     else
  71.         print(helicopter2)
  72.     end
  73.     local event, key = os.pullEvent()
  74.     if event == "key" then
  75.         if key == keys.up then
  76.             if heliPosition ~= 4 then
  77.                 heliPosition = heliPosition - 1
  78.             end
  79.         elseif key == keys.down then
  80.             if heliPosition ~= 6 then
  81.                 heliPosition = heliPosition + 1
  82.             end
  83.         elseif key == keys.space then
  84.             bulletID = #bulletX+1
  85.             bulletX[bulletID] = 25
  86.             bulletY[bulletID] = heliPosition + 4
  87.         end
  88.     elseif event == "timer" then
  89.         if key == heliSpin then
  90.             if helicopter == 1 then
  91.                 helicopter = 2
  92.             else
  93.                 helicopter = 1
  94.             end
  95.             scroll = scroll+1
  96.            
  97.             heliSpin = os.startTimer(0.6)
  98.         elseif key == heliBullet then
  99.             _bulletX = {}
  100.             _bulletY = {}
  101.             local workingBullets = 1
  102.             for i=1,#bulletX do
  103.                 bulletX[i] = bulletX[i] +1
  104.                 if bulletX[i] ~= x-1 then
  105.                     _bulletX[workingBullets] = bulletX[i]
  106.                     _bulletY[workingBullets] = bulletY[i]
  107.                     workingBullets = workingBullets+1
  108.                 end
  109.             end
  110.             bulletX = _bulletX
  111.             bulletY = _bulletY
  112.            
  113.             heliBullet = os.startTimer(0.5)
  114.         end
  115.     end
  116. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement