Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Here is a new Program(Game) for Computercraft, hope you enjoy :D
- --You also have to download the menu for this game: pastebin.com/nYmuKMn1
- --INFORMATION: the "title.img" will be added soon
- --if you find any fails or bugs please contact me i will update it regular
- --You have to install the game with the INSTALLER!!!
- --!!!INSTALLER for the game: --> pastebin.com/hPg7L2QY !!!
- shell.run("clear")
- write("Your Name: ")
- name= io.read()
- fs.makeDir("score")
- a=1
- shell.run("clear")
- print("This game was created for 26x20 advanced pocket computer")
- sleep(5)
- shell.run("clear")
- t=paintutils.loadImage("title.img")
- paintutils.drawImage(t,1,1)
- term.setBackgroundColor(32768)
- sleep(3)
- shell.run("clear")
- score = 0
- while true do
- pos = math.random(1,20)
- function printState()
- shell.run("clear")
- Floor()
- term.setCursorPos(1,1)
- print("Score:"..score)
- term.setCursorPos(pos,10)
- term.setBackgroundColor(256)
- print(" ")
- term.setBackgroundColor(32768)
- end
- function Floor()
- while a < 30 do
- term.setBackgroundColor(4096)
- term.setCursorPos(a,11)
- a=a+1
- print(" ")
- end
- a=1
- term.setBackgroundColor(32768)
- end
- printState()
- sleep(3)
- shell.run("clear")
- print("Score:"..score)
- term.setCursorPos(pos,10)
- term.setBackgroundColor(256)
- print(" ")
- term.setBackgroundColor(32768)
- term.setCursorPos(1,12)
- write("How many pixels is the line away??? ")
- Floor()
- term.setCursorPos(14,13)
- weit=io.read()
- shell.run("clear")
- Floor()
- term.setCursorPos(pos,10)
- term.setBackgroundColor(256)
- print(" ")
- term.setBackgroundColor(32768)
- term.setCursorPos(weit-6,10)
- print("@")
- printState()
- Floor()
- term.setCursorPos(weit-5,10)
- print("@")
- sleep(0.3)
- printState()
- Floor()
- term.setCursorPos(weit-4,10)
- print("@")
- sleep(0.3)
- printState()
- Floor()
- term.setCursorPos(weit-3,10)
- print("@")
- sleep(0.3)
- printState()
- Floor()
- term.setCursorPos(weit-2,10)
- print("@")
- sleep(0.3)
- printState()
- term.setCursorPos(weit-1,10)
- print("@")
- sleep(0.5)
- printState()
- term.setCursorPos(weit,9)
- print("@")
- sleep(0.5)
- printState()
- term.setCursorPos(weit+1,10)
- print("@")
- term.setCursorPos(1,11)
- if weit+0 == pos then
- term.setCursorPos(1,12)
- print("Good")
- sleep(1)
- score = score+1
- shell.run("clear")
- else
- term.setCursorPos(1,12)
- print("Fail, it was "..pos.." Pixels")
- sleep(1)
- print("YOU LOST")
- if fs.exists("score/"..name) then
- list=fs.open("score/"..name,"r")
- firstScore=list.readLine()
- list.close()
- if firstScore+0 < score+0 then
- list = fs.open("score/"..name,"w")
- list.writeLine(score)
- list.close()
- end
- sleep(2)
- shell.run("clear")
- shell.run("JumpMenu")
- break
- else
- newlist=fs.open("score/"..name,"w")
- newlist.writeLine(score)
- newlist.close()
- sleep(1)
- shell.run("clear")
- shell.run("JumpMenu")
- break
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement