Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --welcum to dah gaym cawld flame wars
- --in flawm warz, you r dah roflcoptah in dah plaic wit
- --peepl skidiven an u haz roflcoptah bullet dat go pew
- --pew an u shoot dem innocent skydivzerz dat r falzing
- --or u can go below dem and dey fawll into der bladez,
- --den dey get chopper upped andz u get pointz
- --
- --enjoi playin!
- local heliPosition = 4
- local helicopter1 = [[
- L
- O :LOL:ROFL:ROFL:
- L\\ _____I____
- ========= | |[\
- \____o==___)
- ___I_I__/
- ]]
- local helicopter2 = [[
- LOL ROFL:ROFL:LOL:
- \\ _____I____
- ========= | |[\
- \____o==___)
- ___I_I__/
- ]]
- local enemy = [[
- ___
- ( )
- \o/
- |
- / \
- ]]
- local background1 = " __________ "
- local background2 = " _______ ______________ / \\ "
- local background3 = " ____/ \\ ____/___________ \\ __ ________ _/ ___ \\________ __________ "
- local background4 = "________/ \\______/ \\___\\____/ \\_______/ \\_____/ / \\ \\____________/ \\_____"
- local bullet = "-"
- local helicopter = 1
- local kills = 1
- local scroll = 1
- local x,y = term.getSize()
- local bulletX = {}
- local bulletY = {}
- local enemies = {}
- heliSpin = os.startTimer(0.6)
- heliBullet = os.startTimer(0.5)
- while true do
- levelString = "Points: " ..kills.. " "
- term.clear()
- term.setCursorPos(scroll, y-4)
- print(string.sub(background1, scroll, x+scroll-2))
- print(string.sub(background2, scroll, x+scroll-2))
- print(string.sub(background3, scroll, x+scroll-2))
- print(string.sub(background4, scroll, x+scroll-2))
- for i=1,#bulletX do
- term.setCursorPos(bulletX[i], bulletY[i])
- write(bullet)
- end
- term.setCursorPos(x-#levelString, 1)
- write(levelString)
- term.setCursorPos(1, heliPosition)
- if helicopter == 1 then
- print(helicopter1)
- else
- print(helicopter2)
- end
- local event, key = os.pullEvent()
- if event == "key" then
- if key == keys.up then
- if heliPosition ~= 4 then
- heliPosition = heliPosition - 1
- end
- elseif key == keys.down then
- if heliPosition ~= 6 then
- heliPosition = heliPosition + 1
- end
- elseif key == keys.space then
- bulletID = #bulletX+1
- bulletX[bulletID] = 25
- bulletY[bulletID] = heliPosition + 4
- end
- elseif event == "timer" then
- if key == heliSpin then
- if helicopter == 1 then
- helicopter = 2
- else
- helicopter = 1
- end
- scroll = scroll+1
- heliSpin = os.startTimer(0.6)
- elseif key == heliBullet then
- _bulletX = {}
- _bulletY = {}
- local workingBullets = 1
- for i=1,#bulletX do
- bulletX[i] = bulletX[i] +1
- if bulletX[i] ~= x-1 then
- _bulletX[workingBullets] = bulletX[i]
- _bulletY[workingBullets] = bulletY[i]
- workingBullets = workingBullets+1
- end
- end
- bulletX = _bulletX
- bulletY = _bulletY
- heliBullet = os.startTimer(0.5)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement