Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- update
- -- Dieses Spiel befindet sich in noch in der Entwicklung
- -- Author : waadidas1
- --um das spiel zu speichern in fs.open speichern
- -- das Geld
- --file = fs.makeDir("motor")
- -- save = fs.open("motor","r")
- --geld = save.readLine()
- --save.close()
- --/ das Geld
- -- Hauptwelt
- welt = window.create(term.current(),1,1,51,23)
- welt.setBackgroundColor(colors.blue)
- welt.clear()
- welt.setCursorPos(5,8)
- welt.write("x")
- welt.setCursorPos(2,10)
- welt.setTextColor(colors.black)
- welt.write("X")
- --/Hauptwelt
- --char
- ped = window.create(term.current(),22,7,10,6)
- ped.setBackgroundColor(colors.brown)
- ped.clear()
- ped.setCursorPos(2,2)
- ped.write("(O).(O)")
- ped.setCursorPos(3,4)
- ped.write("____/")
- ped.setCursorPos(4,3)
- ped.write("<")
- --/char
- --Dollar anzeige
- w = window.create(term.current(),1,16,30,4)
- w.setBackgroundColor(colors.green)
- w.clear()
- w.setCursorPos(1,1)
- w.write("Money: ")
- w.setCursorPos(7,3)
- w.write("$")
- w.setCursorPos(8,3)
- w.write("Shop")
- --/dollar anzeige
- --script
- sichtbar = true
- repeat
- if sichtbar == true then
- -- button eins
- event,taste,x,y = os.pullEvent("mouse_click")
- if x>21 and x<33 and y>6 and y<14 then
- --/button eins
- rdm = math.random(1,7)
- geld = geld+rdm
- sv = fs.open("geld","w")
- sv.writeLine(geld)
- sv.close()
- -- dollar anzeige aktualisieren
- w.setCursorPos(1,3)
- w.write(geld)
- end
- if x>7 and x<12 and y == 18
- then term.scroll(30)
- sichtbar = false
- end
- end
- until sichtbar == false
- if sichtbar == false
- then
- --shop seite
- shop = window.create(term.current(),1,1,51,20)
- shop.setBackgroundColor(colors.yellow)
- shop.clear()
- shop.setCursorPos(10,1)
- shop.setTextColor(colors.black)
- shop.write("@X@X@X@X@X@X@ SHOP @X@X@X@X@X@X@")
- shop.setCursorPos(10,18)
- shop.write("@X@X@X@X@X@X@<Back>@X@X@X@X@X@X@")
- repeat
- event,taste,x1,y1 = os.pullEvent("mouse_click")
- if
- x1>23 and x1<30 and y1 == 18 then
- sichtbar = true
- end
- --/shop seite
- until sichtbar == true
- end
- if sichtbar == true then shell.run("startup")
- end
Add Comment
Please, Sign In to add comment