Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- print("WELCOME TO REACT")
- print("A game made by Aio in 2022")
- print("")
- print("Press enter to begin!")
- print("")
- print("The objective is to press any key only when the blue color is shown")
- print("")
- print("CAUTION, FAST FLASHING LIGHTS!!")
- read()
- term.clear()
- score = 0.8
- HP = 1.5
- function bar(p)
- term.setCursorPos(1,1)
- print(string.rep("_",3))
- term.setCursorPos(1,1)
- print(string.rep("#",(p*5)-2))
- end
- while true do
- if HP > 50 then
- print("Game over!")
- print("I suspect that you have been cheating")
- print("This should be humanly impossible!!")
- break
- end
- HP = HP - 0.5
- term.setBackgroundColor(colors.black)
- term.clear()
- if HP == 0.5 then
- term.setTextColor(colors.lime)
- textutils.slowPrint("Game over!")
- print("You got a score of",score)
- sleep(1)
- break
- end
- score = score + 0.2
- print("HP",HP)
- print("SCORE",score)
- print("DELAY",(5/score))
- DELAY = 5/score
- print(DELAY/10)
- for y=0,5 do
- bar((10-y)/10)
- sleep(DELAY/(10-y))
- end
- if math.random(0,100) > 75 then
- term.setBackgroundColor(colors.red)
- R = false
- else
- term.setBackgroundColor(colors.blue)
- R = true
- end
- term.clear()
- os.startTimer(5/score)
- E = os.pullEvent()
- os.cancelTimer(5/score)
- if E == "key" then
- if R == false then
- score = score - 1
- else
- HP = HP + 1
- end
- else
- if R == true then
- score = score - 0.5
- else
- HP = HP + 0.5
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement