Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- monSide = "back"
- mon = peripheral.wrap(monSide)
- local xMax,yMax = mon.getSize()
- function hintergrund()
- mon.setBackgroundColor(colors.cyan)
- for b = 0,xMax,1 do
- for i = 0,yMax,1 do
- mon.setCursorPos(b,i)
- mon.write(" ")
- end
- end
- end
- function animation()
- mon.setBackgroundColor(colors.white)
- g = -2
- for l = 1,8,1 do
- mon.setBackgroundColor(colors.white)
- mon.setCursorPos(l,2)
- mon.write(" ")
- sleep(0.1)
- mon.setBackgroundColor(colors.cyan)
- mon.setCursorPos(g,2)
- mon.write(" ")
- g = g+1
- mon.setBackgroundColor(colors.white)
- end
- --S
- for l = 8,6,-1 do
- mon.setCursorPos(l,2)
- mon.write(" ")
- sleep(0.1)
- end
- mon.setCursorPos(6,3)
- mon.write(" ")
- sleep(0.1)
- for l = 6,8,1 do
- mon.setCursorPos(l,4)
- mon.write(" ")
- sleep(0.1)
- end
- mon.setCursorPos(8,5)
- mon.write(" ")
- sleep(0.1)
- for l = 8,6,-1 do
- mon.setCursorPos(l,6)
- mon.write(" ")
- sleep(0.1)
- end
- --N
- for l = 6,2,-1 do
- mon.setCursorPos(10,l)
- mon.write(" ")
- sleep(0.1)
- end
- mon.setCursorPos(11,2)
- g = 11
- for l = 3,5,1 do
- mon.setCursorPos(g,l)
- mon.write(" ")
- g=g+1
- sleep(0.1)
- end
- for l = 6,2,-1 do
- mon.setCursorPos(14,l)
- mon.write(" ")
- sleep(0.1)
- end
- --A
- for l = 6,3,-1 do
- mon.setCursorPos(16,l)
- mon.write(" ")
- sleep(0.1)
- end
- for l = 17,18,1 do
- mon.setCursorPos(l,2)
- mon.write(" ")
- sleep(0.1)
- end
- for l = 3,6,1 do
- mon.setCursorPos(19,l)
- mon.write(" ")
- sleep(0.1)
- end
- for l = 17,18,1 do
- mon.setCursorPos(l,4)
- mon.write(" ")
- sleep(0.1)
- end
- --K
- for l = 6,2,-1 do
- mon.setCursorPos(21,l)
- mon.write(" ")
- sleep(0.1)
- end
- g = 4
- for l = 22,24,1 do
- mon.setCursorPos(l,g)
- mon.write(" ")
- g=g-1
- sleep(0.1)
- end
- g = 5
- for l = 23,24,1 do
- mon.setCursorPos(l,g)
- mon.write(" ")
- g=g+1
- sleep(0.1)
- end
- --E
- for l = 6,2,-1 do
- mon.setCursorPos(26,l)
- mon.write(" ")
- sleep(0.1)
- end
- for g = 2,6,2 do
- for l = 27,28,1 do
- mon.setCursorPos(l,g)
- mon.write(" ")
- sleep(0.1)
- end
- end
- g = 27
- for l = 29,xMax,1 do
- mon.setBackgroundColor(colors.white)
- mon.setCursorPos(l,6)
- mon.write(" ")
- sleep(0.1)
- if g >= 29 then
- mon.setBackgroundColor(colors.cyan)
- mon.setCursorPos(g,6)
- mon.write(" ")
- end
- g=g+1
- end
- snake=xMax-5
- for l = xMax,snake,-1 do
- mon.setBackgroundColor(colors.cyan)
- mon.setCursorPos(l,6)
- mon.write(" ")
- end
- end
- function steuerung()
- mon.setBackgroundColor(colors.black)
- mon.setTextColor(colors.white)
- mon.setCursorPos(60,15)
- mon.write("W")
- mon.setCursorPos(57,17)
- mon.write("A")
- mon.setCursorPos(60,17)
- mon.write("+")
- mon.setCursorPos(63,17)
- mon.write("S")
- mon.setCursorPos(60,19)
- mon.write("D")
- end
- function hauptmenu()
- hintergrund()
- animation()
- steuerung()
- mon.setBackgroundColor(colors.cyan)
- mon.setTextScale(1)
- mon.setTextColor(colors.white)
- mon.setCursorPos(7,8)
- mon.write("[Spiel starten]")
- sleep(0.5)
- mon.setCursorPos(7,9)
- mon.write("[Optionen]")
- sleep(0.5)
- mon.setCursorPos(7,10)
- mon.write("[Anleitung]")
- sleep(0.5)
- mon.setCursorPos(7,11)
- mon.write("[Beenden]")
- end
- hauptmenu()
- os.loadAPI("ocs/apis/sensor")
- proximity = sensor.wrap("top")
- player = "warte auf Spieler..."
- while true do
- sleep(0.2)
- targets = proximity.getTargets()
- for k,v in pairs(targets) do
- if v.Name == "Player"
- and v.Position.X<=3 and v.Position.X>=-3
- and v.Position.Z<=9 and v.Position.Z>=3
- and v.Position.Y>=-3 and v.Position.Y<=4
- then
- player = k
- else
- player = "warte auf Spieler..."
- --W
- if v.Name == "Player" and
- v.Position.X>=-0.5 and v.Position.X <=0.5 and
- v.Position.Z>=4.5 and v.Position.Z<=5.5 and
- v.Position.Y>=-3 and v.Position.Y<=4 then
- print("W")
- end
- if v.Name == "Player" then
- print(v.Position.X .." ".. v.Position.Z .." ".. v.Position.Y)
- end
- end
- end
- for l = 1,xMax,1 do
- mon.setCursorPos(l,1)
- mon.setBackgroundColor(colors.cyan)
- mon.write(" ")
- end
- mon.setCursorPos(1,1)
- mon.setBackgroundColor(colors.black)
- mon.write(player)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment