x1 = 21 #Anfangs- x-Koordinaten (Des Spielbereiches) x2 = 58 #End- x-Koordinaten (Des Spielbereiches) y1 = -30 #Anfangs- y-Koordinaten y2 = -60 #End- y-Koordinaten z1 = -26 #Anfangs- z-Koordinaten z2 = -49 #End- z-Koordinaten ySpiel = -42 #Höhe des Spiels (Der Plattformen) def gamerules(): #Passt die Welt an gameplay.time_set(DayTime.MIDNIGHT) #Macht die Welt dunkel gameplay.set_game_rule(DAYLIGHT_CYCLE, False) #Es kann nicht mehr hell werden gameplay.set_game_rule(WEATHER_CYCLE, False) #Wetter ändert nicht mehr gameplay.set_weather(CLEAR) #Macht klares Wetter def arenaWalls(): #Baut die vier Wände der Arena a = world(x1, y2, z2) b = world(x1, y2, z1) c = world(x2, y2, z1) d = world(x2, y2, z2) a1 = world(x1, y1, z2) b1 = world(x1, y1, z1) c1 = world(x2, y1, z1) d1 = world(x2, y1, z2) blocks.fill(GRAY_CONCRETE, a, d1) blocks.fill(RED_CONCRETE, a, b1) blocks.fill(RED_CONCRETE, d, c1) blocks.fill(GRAY_CONCRETE, c, b1) blocks.fill(BLACK_CONCRETE, a, c) #Boden def dach(): #Baut das schwarze Dach for height in range(-29, -17, 4): blocks.fill(BLACK_STAINED_GLASS, world(x1, height, z1), world(x2, height, z2)) def endrodDach(): #Baut die Belichtung im Dach for i in range(1, 50): x = randint(x1, x2) #Nimmt einen zufälligen Wert von x und z y = (-28) z = randint(z1, z2) blocks.place(END_ROD, world(x, y, z)) x = randint(x1, x2) #Nochmal andere zufällige Werte, damit es nicht die gleichen sind z = randint(z1, z2) blocks.place(END_ROD, world(x, y+2, z)) x = randint(x1, x2) #'' z = randint(z1, z2) blocks.place(END_ROD, world(x, y+4, z)) x = randint(x1, x2) #'' z = randint(z1, z2) blocks.place(END_ROD, world(x, y+6, z)) def endrodWall(): #Baut Belichtung an der Seite for i in range(1, 100): x = randint(x1+1, x2-1) #Zufallige Werte ±1 => Innerhalb Arena y = randint(y1, y2+1) z = z1-1 blocks.place(END_ROD, world(x, y, z)) x = randint(x1+1, x2-1) #'' y = randint(y1, y2+1) z = z2+1 blocks.place(END_ROD, world(x, y, z)) def eisplattform(): #Baut die Eisplattformen des Minispiels x = 27 z = -35 for ice in range(0, 28, 4): blocks.fill(BLUE_ICE, world(x+ice, ySpiel, z), world(x+1+ice, ySpiel, z-1)) blocks.fill(BLUE_ICE, world(x+ice, ySpiel, z-4), world(x+1+ice, ySpiel, z-5)) def spielerplattform(): #Plattform des Startes und Zieles blocks.fill(BLACK_CONCRETE, world(x1+1, ySpiel, z1-7), world(x1+3, ySpiel, z2+7)) blocks.fill(BLACK_CONCRETE, world(x2-1, ySpiel, z1-7), world(x2-3, ySpiel, z2+7)) for deko in range(1, 11, 9): blocks.place(AIR, world(x1+3, ySpiel, z1-6-deko)) #Dekoration (Weniger 'Blockig') blocks.place(AIR, world(x2-3, ySpiel, z1-6-deko)) def buildHiddenMechanic(): #Baut das, was für das Funktionieren des Minigames benötigt wird (Im Spiel sieht man es nicht). x = 27 z = -35 for coal in range(0, 28, 4): linksOdaRechts = randint(1, 2) if (linksOdaRechts==1): blocks.fill(COAL_BLOCK, world(x+coal, y2-1, z), world(x+1+coal, y2-1, z-1)) if (linksOdaRechts==2): blocks.fill(COAL_BLOCK, world(x+coal, y2-1, z-4), world(x+1+coal, y2-1, z-5)) def enddach(): #Baut das Dach (Das Schwarze + Belichtung) dach() endrodDach() def buildArena(): #Baut die ganze Arena (Wände, Plattformen, Belichtung) arenaWalls() spielerplattform() eisplattform() buildHiddenMechanic() endrodWall() enddach() def destroyArena(): #Entfernt das ganze Gebaute for destroy in range(0, 38, 1): blocks.fill(AIR, world(x1+destroy, y2, z2), world(x1+destroy, y2+40, z1)) blocks.fill(GRASS, world(x1, y2-1, z1), world(x2, y2-1, z2)) def on_chat(): #Wenn restart im Chat geschrieben wird.. eisplattform() blocks.fill(GRASS, world(x1, y2-1, z1), world(x2, y2-1, z2)) buildHiddenMechanic() #Arena bleibt bestehen, gute und schlechte Plattformen werden neu durchmischt und Plattformen neugebaut player.on_chat("restart", on_chat) player.teleport(world(30, -59, -38)) #Zuerst teleport, damit __alles__ gebaut wird (Ohne fehlen Wände, da der Code sonst ausser Reichweite ist). gamerules() destroyArena() buildArena()