Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
| gf2:projekte:minecraft:2d1gruppe2 [2023/01/23 09:24] – staempflim | gf2:projekte:minecraft:2d1gruppe2 [2023/02/26 08:41] (aktuell) – marroc | ||
|---|---|---|---|
| Zeile 5: | Zeile 5: | ||
| *Was wollen wir bauen?* | *Was wollen wir bauen?* | ||
| * Hoppscotch. Minigame aus Squid Game | * Hoppscotch. Minigame aus Squid Game | ||
| + | * Die Idee kam recht spontan, jedoch recht einfach verständlich. Als erstes sollte man den Grundriss des Minigames bauen. Bei uns die Arena. Dann wie das Game funktioniert und am Ende Dekos. | ||
| ---- | ---- | ||
| Zeile 10: | Zeile 11: | ||
| * 1. Code ist für das Bauen der Arena. Dima & Mike only! | * 1. Code ist für das Bauen der Arena. Dima & Mike only! | ||
| * 2. Code ist für das Minigame. Jeder | * 2. Code ist für das Minigame. Jeder | ||
| - | * 3. Code ist für diejenigen, die alleine Spielen (Neue Flachwelt erstellen dann ausführen). | + | * 3. Code ist für diejenigen, die alleine Spielen (Code 1&2 kombiniert, |
| + | * 4. Link zur Präsentation | ||
| ---- | ---- | ||
| Zeile 19: | Zeile 21: | ||
| ---- | ---- | ||
| - | *Le Code (Zum Bauen der Arena)* | + | (1. Code) *Le Code zum Bauen der Arena* |
| - | <code python> | + | <code python |
| x1 = 21 #Anfangs- x-Koordinaten (Des Spielbereiches) | x1 = 21 #Anfangs- x-Koordinaten (Des Spielbereiches) | ||
| x2 = 58 #End- x-Koordinaten (Des Spielbereiches) | x2 = 58 #End- x-Koordinaten (Des Spielbereiches) | ||
| Zeile 133: | Zeile 135: | ||
| buildArena() | buildArena() | ||
| </ | </ | ||
| - | Unsere Welt sah am Schluss sehr interessant aus.. | + | |
| ---- | ---- | ||
| {{: | {{: | ||
| + | Unsere Welt sah am Schluss sehr interessant aus.. | ||
| ---- | ---- | ||
| - | *Le Code (Für das Funktionieren des Minigames)* | + | (2. Code) *Le Code für das Minigame* |
| - | ---- | + | |
| <code python> | <code python> | ||
| x1 = 21 #Anfangs- x-Koordinaten (Des Spielbereiches) | x1 = 21 #Anfangs- x-Koordinaten (Des Spielbereiches) | ||
| Zeile 181: | Zeile 183: | ||
| </ | </ | ||
| {{: | {{: | ||
| + | // | ||
| + | * Klickt auf das Bild links, um das gif zu sehen. | ||
| + | * Wie das Spiel funktioniert :')// | ||
| + | ---- | ||
| + | (3. Code) *Le Code für die Solospieler unter uns* | ||
| + | <code python> | ||
| + | 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(): | ||
| + | gameplay.time_set(DayTime.MIDNIGHT) #Macht die Welt dunkel | ||
| + | gameplay.set_game_rule(DAYLIGHT_CYCLE, | ||
| + | gameplay.set_game_rule(WEATHER_CYCLE, | ||
| + | gameplay.set_weather(CLEAR) #Macht klares Wetter | ||
| + | gameplay.set_game_mode(ADVENTURE, | ||
| + | |||
| + | def arenaWalls(): | ||
| + | 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, | ||
| + | blocks.fill(RED_CONCRETE, | ||
| + | blocks.fill(RED_CONCRETE, | ||
| + | blocks.fill(GRAY_CONCRETE, | ||
| + | blocks.fill(BLACK_CONCRETE, | ||
| + | |||
| + | def dach(): #Baut das schwarze Dach | ||
| + | for height in range(-29, -17, 4): | ||
| + | blocks.fill(BLACK_STAINED_GLASS, | ||
| + | |||
| + | def endrodDach(): | ||
| + | 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, | ||
| + | x = randint(x1, x2) #Nochmal andere zufällige Werte, damit es nicht die gleichen sind | ||
| + | z = randint(z1, z2) | ||
| + | blocks.place(END_ROD, | ||
| + | x = randint(x1, x2) #'' | ||
| + | z = randint(z1, z2) | ||
| + | blocks.place(END_ROD, | ||
| + | x = randint(x1, x2) #'' | ||
| + | z = randint(z1, z2) | ||
| + | blocks.place(END_ROD, | ||
| + | |||
| + | def endrodWall(): | ||
| + | for i in range(1, 100): | ||
| + | x = randint(x1+1, | ||
| + | y = randint(y1, y2+1) | ||
| + | z = z1-1 | ||
| + | blocks.place(END_ROD, | ||
| + | x = randint(x1+1, | ||
| + | y = randint(y1, y2+1) | ||
| + | z = z2+1 | ||
| + | blocks.place(END_ROD, | ||
| + | |||
| + | def eisplattform(): | ||
| + | x = 27 | ||
| + | z = -35 | ||
| + | for ice in range(0, 28, 4): | ||
| + | blocks.fill(BLUE_ICE, | ||
| + | blocks.fill(BLUE_ICE, | ||
| + | |||
| + | def spielerplattform(): | ||
| + | blocks.fill(BLACK_CONCRETE, | ||
| + | blocks.fill(BLACK_CONCRETE, | ||
| + | for deko in range(1, 11, 9): | ||
| + | blocks.place(AIR, | ||
| + | blocks.place(AIR, | ||
| + | |||
| + | def buildHiddenMechanic(): | ||
| + | x = 27 | ||
| + | z = -35 | ||
| + | for coal in range(0, 28, 4): | ||
| + | linksOdaRechts = randint(1, 2) | ||
| + | if (linksOdaRechts==1): | ||
| + | blocks.fill(COAL_BLOCK, | ||
| + | if (linksOdaRechts==2): | ||
| + | blocks.fill(COAL_BLOCK, | ||
| + | |||
| + | def enddach(): #Baut das Dach (Das Schwarze + Belichtung) | ||
| + | dach() | ||
| + | endrodDach() | ||
| + | |||
| + | def buildArena(): | ||
| + | arenaWalls() | ||
| + | spielerplattform() | ||
| + | eisplattform() | ||
| + | buildHiddenMechanic() | ||
| + | endrodWall() | ||
| + | enddach() | ||
| + | |||
| + | def destroyArena(): | ||
| + | for destroy in range(0, 38, 1): | ||
| + | blocks.fill(AIR, | ||
| + | blocks.fill(GRASS, | ||
| + | |||
| + | def on_chat(): #Wenn restart im Chat geschrieben wird.. | ||
| + | eisplattform() | ||
| + | blocks.fill(GRASS, | ||
| + | buildHiddenMechanic() #Arena bleibt bestehen, gute und schlechte Plattformen werden neu durchmischt und Plattformen neugebaut | ||
| + | player.on_chat(" | ||
| + | |||
| + | def teleport(): # | ||
| + | player.teleport(world(x1+2, | ||
| + | player.execute("/ | ||
| + | |||
| + | def minigame(): #Code für das Minigame | ||
| + | x = player.position().get_value(Axis.X) #Nimmt die derzeitige Position des Spielers | ||
| + | y = player.position().get_value(Axis.Y) | ||
| + | z = player.position().get_value(Axis.Z) | ||
| + | if (x2 > x > x1) and (y2 < y < y1) and (z1 > z > z2): #der Bereich Hoppscotch (Des Minigames) | ||
| + | while (x2 > x > x1) and (ySpiel < y < y1) and (z1 > z > z2): #Solange man im Bereiches der Arena und __über__ der Höhe der Plattformen ist | ||
| + | x = player.position().get_value(Axis.X) #Wenn die Zeile oben passt, muss das Programm nochmal die Position bekommen | ||
| + | y = player.position().get_value(Axis.Y) | ||
| + | z = player.position().get_value(Axis.Z) | ||
| + | |||
| + | if blocks.test_for_block(COAL_BLOCK, | ||
| + | xnow = x | ||
| + | ynow = y | ||
| + | znow = z | ||
| + | blocks.fill(AIR, | ||
| + | player.execute("/ | ||
| + | |||
| + | while (x2 > x > x1) and (y2 < y < ySpiel) and (z1 > z > z2): #Solange man im Bereiches der Arena und __unter__ der Höhe der Plattformen ist | ||
| + | x = player.position().get_value(Axis.X) | ||
| + | y = player.position().get_value(Axis.Y) | ||
| + | z = player.position().get_value(Axis.Z) | ||
| + | |||
| + | if (x2 > x > x1) and (y2 < y < ySpiel-2) and (z1 > z > z2): #Solange man im Bereich Hoppscotch ist | ||
| + | player.execute("/ | ||
| + | |||
| + | player.teleport(world(30, | ||
| + | gamerules() | ||
| + | destroyArena() | ||
| + | buildArena() | ||
| + | teleport() | ||
| + | loops.forever(minigame) #Lässt minigame() immer aktiv sein | ||
| + | </ | ||
| + | |||
| + | 4. Link zur Präsentation | ||
| + | * https:// | ||