gf2:projekte:2024:minecraft:2d1gruppe1

Dies ist eine alte Version des Dokuments!


Gruppe 1

Fussballstadion (Inspiration vom Old Trafford Stadion)

Gesamtgrösse: 40×70 in flacher, leeren Welt

Weisser Beton(Grundlage), Red Stone (Tribüne) Eis Zaun

  • Boden
  • Tribüne
  • Spielfeldlinien
  • Tore
  • Auswechselbank
  • Decke (halb offen)
  • Licht
  • Spieler (in Bewegung)
  • Ball (in Bewegung
  • Anzeigetafel
  • Auswechselbank
  • Anzeigetafel

Diese Elemente wurden aufgrund von Zeitmangel weggelassen, weil andere Elemente wie das Tor und der bewegende Ball mehr Zeit in Anspruch nahmen als wir anfangs dachten

  • Türen um das Stadion zu betreten
  • Beleuchtung im Stadion
  • Zaun
  • Ball

Skizze des Fussballplatzes(zur Vorstellung), Material für die jeweiligen Elemente festlegen, Einzelne Elemente programmieren(in kleinen Schritten) –>Elemente sind:…, Programmcode kommentieren/erklären, Dokumentation auf dem Wiki aktualisieren, Planung auf dem Scrumboard erweitern

position = (-957, -60, 1341)
radius = 12
 
def feed(x,y,z):
    blocks.fill(AIR, world(x-1, y, z), world(x+60, y+20, z+100),FillOperation.REPLACE)
    blocks.fill(GREEN_CARPET, world(x, y, z), world(x+40, y, z+70),FillOperation.REPLACE) #Grünes Fussballfeld wird gebaut
    blocks.fill(ICE, world(x+3, y-3, z), world(x+37, y-1, z+66), FillOperation.REPLACE)
    for i in range(radius):
        blocks.fill(blocks.block_with_data(BRICK_STAIRS, 1), world(x, y, z), world(x, y, z+70),FillOperation.REPLACE) #Tribüne wird gebaut 
        blocks.fill(blocks.block_with_data(BRICK_STAIRS, 2), world(x, y, z+70), world(x+40, y, z+70),FillOperation.REPLACE)
        blocks.fill(blocks.block_with_data(BRICK_STAIRS, 0), world(x+40, y, z+70), world(x+40, y, z),FillOperation.REPLACE)
        blocks.fill(blocks.block_with_data(BRICK_STAIRS, 3), world(x+40, y, z), world(x, y, z),FillOperation.REPLACE)
        blocks.fill(blocks.block_with_data(BRICK_STAIRS, 1), world(x-i, y+i, z-i), world(x-i, y+i, z+70+i),FillOperation.REPLACE)
        blocks.fill(blocks.block_with_data(BRICK_STAIRS, 2), world(x-i, y+i, z+70+i), world(x+40+i, y+i, z+70+i),FillOperation.REPLACE)
        blocks.fill(blocks.block_with_data(BRICK_STAIRS, 0), world(x+40+i, y+i, z+70+i), world(x+40+i, y+i, z-i),FillOperation.REPLACE)
        blocks.fill(blocks.block_with_data(BRICK_STAIRS, 3), world(x+40+i, y+i, z-i), world(x-i, y+i, z-i),FillOperation.REPLACE)
        blocks.fill(blocks.block_with_data(BRICK_STAIRS, 1), world(x-i, y+i, z-i), world(x-i, y+i, z+70+i),FillOperation.REPLACE)
        blocks.fill(blocks.block_with_data(BRICK_STAIRS, 2), world(x-i, y+i, z+70+i), world(x+40+i, y+i, z+70+i),FillOperation.REPLACE)
        blocks.fill(blocks.block_with_data(BRICK_STAIRS, 0), world(x+40+i, y+i, z+70+i), world(x+40+i, y+i, z-i),FillOperation.REPLACE)
        blocks.fill(blocks.block_with_data(BRICK_STAIRS, 3), world(x+40+i, y+i, z-i), world(x-i, y+i, z-i),FillOperation.REPLACE)
def mobspawn(x,y,z):
    for i in range(100):
        mobs.spawn(VILLAGER, world(x+0, y, z+0)), world(x+100, y, Z+1)
    for i in range(100):
        mobs.spawn(VILLAGER, world(x, y, z+50)), world(x+100, y, Z+1)
    for i in range(100):
        mobs.spawn(VILLAGER, world(x, y, z+100)), world(x+100, y, Z+1)
    for i in range (1):
        mobs.spawn(ARMADILLO, world(x+25, y, z+15))
 
position = (-957, -60, 1341) #Selber Koordinaten eingeben
radius = 12
def stadiondach(x, y, z, length, width, height, material): #stadiondach ort wird definiert
    for i in range(radius):
        y_now = y - int(height / radius * i)
        blocks.fill(material, world(x + i, y_now, z + i), world(x + length - i - 1, y_now, z + width - i - 1), FillOperation.REPLACE)
        blocks.fill(AIR, world(x + i + 1, y_now, z + i + 1), world(x + length - i - 2, y_now, z + width - i - 2), FillOperation.REPLACE)
 
    return 1
blocks.print("Manchester United", REDSTONE_BLOCK, world(x, y, z),0)
blocks.fill(SHROOMLIGHT, world(x-4, y+9, z-3), world(x+45, y+9, z-5), FillOperation.REPLACE)  # Hinten, 2 Blöcke höher
blocks.fill(SHROOMLIGHT, world(x-4, y+9, z+73), world(x+45, y+9, z+71), FillOperation.REPLACE) # Vorne, 2 Blöcke höher
 
blocks.fill(SHROOMLIGHT, world(x-4, y+9, z-3), world(x-5, y+9, z+71), FillOperation.REPLACE)   # Links, längere Beleuchtung
blocks.fill(SHROOMLIGHT, world(x+45, y+9, z-3), world(x+45, y+9, z+71), FillOperation.REPLACE) # Rechts, längere Beleuchtung
    blocks.fill(OAK_FENCE, world(x+2, y, z+3), world(x+2, y, z+67), FillOperation.REPLACE)  # Rechts
    blocks.fill(OAK_FENCE, world(x+38, y, z+3), world(x+38, y, z+67), FillOperation.REPLACE) # Links
    blocks.fill(OAK_FENCE, world(x+3, y, z+2), world(x+37, y, z+2), FillOperation.REPLACE)   # Hinten
    blocks.fill(OAK_FENCE, world(x+3, y, z+68), world(x+37, y, z+68), FillOperation.REPLACE)
 
    Eckzäune 
    blocks.place(OAK_FENCE, world(x+2, y, z+2))    # Hinten rechts
    blocks.place(OAK_FENCE, world(x+2, y, z+68))   # Vorne rechts
    blocks.place(OAK_FENCE, world(x+38, y, z+2))   # Hinten links
    blocks.place(OAK_FENCE, world(x+38, y, z+68))  # Vorne links
running = True # solange dies auf True ist, läuft der Game-Loop
 
def stopGame(): # wenn "stop" in den Chat geschrieben wird, running auf False setzen
    global running
    running = False
 
player.on_chat("stop", stopGame)
 
x = 716
frame = 0
 
while running:
    frame += 1
    if (frame % 50 == 0):  # immer nach 50 Frames
        for i in range(70):
            blocks.place(DIAMOND_BLOCK, world(x+1+i,-60,0))  # Block an neuer Position bauen
            blocks.place(AIR, world(x+i, -60, 0))   # Block löschen
        for i in range(70):
             blocks.place(DIAMOND_BLOCK, world(x-1-i,-60,0))  # Block an neuer Position bauen
             blocks.place(AIR, world(x-i, -60, 0))
running = True # solange dies auf True ist, läuft der Game-Loop
 
for i in range (1):
        mobs.spawn(ARMADILLO, world(x+25, y, z+15))
 
 
 
def platz(x,y,z):
    blocks.fill(WHITE_CARPET, world(x+3, y, z+3), world(x+37, y, z+3),FillOperation.REPLACE)#Streifen Auf Feld
    blocks.fill(WHITE_CARPET, world(x+3, y, z+3), world(x+3, y, z+67),FillOperation.REPLACE)
    blocks.fill(WHITE_CARPET, world(x+37, y, z+3), world(x+37, y, z+67),FillOperation.REPLACE)
    blocks.fill(WHITE_CARPET, world(x+37, y, z+67), world(x+3, y, z+67),FillOperation.REPLACE)
    blocks.fill(WHITE_CARPET, world(x+16, y, z+7), world(x+24, y, z+7),FillOperation.REPLACE)#Rechts Goal streifen
    blocks.fill(WHITE_CARPET, world(x+16, y, z+7), world(x+16, y, z+4),FillOperation.REPLACE)
    blocks.fill(WHITE_CARPET, world(x+24, y, z+7), world(x+24, y, z+4),FillOperation.REPLACE)
    blocks.fill(WHITE_CARPET, world(x+24, y, z+63), world(x+24, y, z+66),FillOperation.REPLACE)#links Goal streifen
    blocks.fill(WHITE_CARPET, world(x+16, y, z+63), world(x+16, y, z+66),FillOperation.REPLACE)
    blocks.fill(WHITE_CARPET, world(x+16, y, z+63), world(x+24, y, z+63),FillOperation.REPLACE)
    blocks.fill(WHITE_CARPET, world(x+3, y, z+35), world(x+37, y, z+35),FillOperation.REPLACE)#Mittlerer Streifen
    blocks.fill(WHITE_CARPET, world(x+20, y, z+33), world(x+21, y, z+33),FillOperation.REPLACE)#kreis in der Mitte
    blocks.fill(WHITE_CARPET, world(x+19, y, z+34), world(x+19, y, z+34),FillOperation.REPLACE)
    blocks.fill(WHITE_CARPET, world(x+22, y, z+34), world(x+22, y, z+34),FillOperation.REPLACE)
    blocks.fill(WHITE_CARPET, world(x+19, y, z+36), world(x+19, y, z+35),FillOperation.REPLACE)
    blocks.fill(WHITE_CARPET, world(x+22, y, z+36), world(x+22, y, z+36),FillOperation.REPLACE)
    blocks.fill(WHITE_CARPET, world(x+20, y, z+37), world(x+21, y, z+37),FillOperation.REPLACE)
    blocks.fill(AIR, world(x, y, z+35), world(x-2, y+1, z+36),FillOperation.REPLACE) #Türen werden gebaut
    blocks.fill(BIRCH_DOOR, world(x-1, y, z+35), world(x-1, y+1, z+36),FillOperation.REPLACE)
    blocks.fill(AIR, world(x+40, y, z+35), world(x+42, y+1, z+36),FillOperation.REPLACE)
    blocks.fill(BIRCH_DOOR, world(x+42, y, z+35), world(x+42, y+1, z+36),FillOperation.REPLACE)
    blocks.fill(WHITE_CONCRETE, world(x+16, y, z+4), world(x+16, y+4, z+4),FillOperation.REPLACE) #Tor Rechts
    blocks.fill(WHITE_CONCRETE, world(x+24, y, z+4), world(x+24, y+4, z+4),FillOperation.REPLACE)
    blocks.fill(WHITE_CONCRETE, world(x+16, y+4, z+4), world(x+24, y+4, z+4),FillOperation.REPLACE)
    blocks.fill(COBWEB, world(x+17, y, z+4), world(x+23, y+3, z+4),FillOperation.REPLACE)
    blocks.fill(WHITE_CONCRETE, world(x+24, y, z+66), world(x+24, y+4, z+66),FillOperation.REPLACE) #tor links
    blocks.fill(WHITE_CONCRETE, world(x+16, y, z+66), world(x+16, y+4, z+66),FillOperation.REPLACE)
    blocks.fill(WHITE_CONCRETE, world(x+16, y+4, z+66), world(x+24, y+4, z+66),FillOperation.REPLACE)
    blocks.fill(COBWEB, world(x+17, y, z+66), world(x+23, y+3, z+66),FillOperation.REPLACE)
    blocks.fill(OAK_FENCE, world(x+2, y, z+3), world(x+2, y, z+67), FillOperation.REPLACE)  # Rechts
    blocks.fill(OAK_FENCE, world(x+38, y, z+3), world(x+38, y, z+67), FillOperation.REPLACE) # Links
    blocks.fill(OAK_FENCE, world(x+3, y, z+2), world(x+37, y, z+2), FillOperation.REPLACE)   # Hinten
    blocks.fill(OAK_FENCE, world(x+3, y, z+68), world(x+37, y, z+68), FillOperation.REPLACE) # Vorne
    blocks.fill(SHROOMLIGHT, world(x-4, y+9, z-3), world(x+45, y+9, z-5), FillOperation.REPLACE)  # Hinten, 2 Blöcke höher
    blocks.fill(SHROOMLIGHT, world(x-4, y+9, z+73), world(x+45, y+9, z+71), FillOperation.REPLACE) # Vorne, 2 Blöcke höher
    blocks.fill(SHROOMLIGHT, world(x-4, y+9, z-3), world(x-5, y+9, z+71), FillOperation.REPLACE)   # Links, längere Beleuchtung
    blocks.fill(SHROOMLIGHT, world(x+45, y+9, z-3), world(x+45, y+9, z+71), FillOperation.REPLACE) # Rechts, längere Beleuchtung
 
    # Eckzäune (4 Ecken extra absichern)
    blocks.place(OAK_FENCE, world(x+2, y, z+2))    # Hinten rechts
    blocks.place(OAK_FENCE, world(x+2, y, z+68))   # Vorne rechts
    blocks.place(OAK_FENCE, world(x+38, y, z+2))   # Hinten links
    blocks.place(OAK_FENCE, world(x+38, y, z+68))  # Vorne links

Fertiger Code

position = (-957, -60, 1341) #Selber Koordinaten eingeben
radius = 12
 
def feed(x,y,z):
    blocks.fill(AIR, world(x-1, y, z), world(x+60, y+20, z+100),FillOperation.REPLACE)
    blocks.fill(GREEN_CARPET, world(x, y, z), world(x+40, y, z+70),FillOperation.REPLACE) #Grünes Fussballfeld wird gebaut
    blocks.fill(ICE, world(x+3, y-3, z), world(x+37, y-1, z+66), FillOperation.REPLACE)
    for i in range(radius):
        blocks.fill(blocks.block_with_data(BRICK_STAIRS, 1), world(x, y, z), world(x, y, z+70),FillOperation.REPLACE) #Tribüne wird gebaut 
        blocks.fill(blocks.block_with_data(BRICK_STAIRS, 2), world(x, y, z+70), world(x+40, y, z+70),FillOperation.REPLACE)
        blocks.fill(blocks.block_with_data(BRICK_STAIRS, 0), world(x+40, y, z+70), world(x+40, y, z),FillOperation.REPLACE)
        blocks.fill(blocks.block_with_data(BRICK_STAIRS, 3), world(x+40, y, z), world(x, y, z),FillOperation.REPLACE)
        blocks.fill(blocks.block_with_data(BRICK_STAIRS, 1), world(x-i, y+i, z-i), world(x-i, y+i, z+70+i),FillOperation.REPLACE)
        blocks.fill(blocks.block_with_data(BRICK_STAIRS, 2), world(x-i, y+i, z+70+i), world(x+40+i, y+i, z+70+i),FillOperation.REPLACE)
        blocks.fill(blocks.block_with_data(BRICK_STAIRS, 0), world(x+40+i, y+i, z+70+i), world(x+40+i, y+i, z-i),FillOperation.REPLACE)
        blocks.fill(blocks.block_with_data(BRICK_STAIRS, 3), world(x+40+i, y+i, z-i), world(x-i, y+i, z-i),FillOperation.REPLACE)
        blocks.fill(blocks.block_with_data(BRICK_STAIRS, 1), world(x-i, y+i, z-i), world(x-i, y+i, z+70+i),FillOperation.REPLACE)
        blocks.fill(blocks.block_with_data(BRICK_STAIRS, 2), world(x-i, y+i, z+70+i), world(x+40+i, y+i, z+70+i),FillOperation.REPLACE)
        blocks.fill(blocks.block_with_data(BRICK_STAIRS, 0), world(x+40+i, y+i, z+70+i), world(x+40+i, y+i, z-i),FillOperation.REPLACE)
        blocks.fill(blocks.block_with_data(BRICK_STAIRS, 3), world(x+40+i, y+i, z-i), world(x-i, y+i, z-i),FillOperation.REPLACE)
 
def platz(x,y,z):
    blocks.fill(WHITE_CARPET, world(x+3, y, z+3), world(x+37, y, z+3),FillOperation.REPLACE)#Streifen Auf Feld
    blocks.fill(WHITE_CARPET, world(x+3, y, z+3), world(x+3, y, z+67),FillOperation.REPLACE)
    blocks.fill(WHITE_CARPET, world(x+37, y, z+3), world(x+37, y, z+67),FillOperation.REPLACE)
    blocks.fill(WHITE_CARPET, world(x+37, y, z+67), world(x+3, y, z+67),FillOperation.REPLACE)
    blocks.fill(WHITE_CARPET, world(x+16, y, z+7), world(x+24, y, z+7),FillOperation.REPLACE)#Rechts Goal streifen
    blocks.fill(WHITE_CARPET, world(x+16, y, z+7), world(x+16, y, z+4),FillOperation.REPLACE)
    blocks.fill(WHITE_CARPET, world(x+24, y, z+7), world(x+24, y, z+4),FillOperation.REPLACE)
    blocks.fill(WHITE_CARPET, world(x+24, y, z+63), world(x+24, y, z+66),FillOperation.REPLACE)#links Goal streifen
    blocks.fill(WHITE_CARPET, world(x+16, y, z+63), world(x+16, y, z+66),FillOperation.REPLACE)
    blocks.fill(WHITE_CARPET, world(x+16, y, z+63), world(x+24, y, z+63),FillOperation.REPLACE)
    blocks.fill(WHITE_CARPET, world(x+3, y, z+35), world(x+37, y, z+35),FillOperation.REPLACE)#Mittlerer Streifen
    blocks.fill(WHITE_CARPET, world(x+20, y, z+33), world(x+21, y, z+33),FillOperation.REPLACE)#kreis in der Mitte
    blocks.fill(WHITE_CARPET, world(x+19, y, z+34), world(x+19, y, z+34),FillOperation.REPLACE)
    blocks.fill(WHITE_CARPET, world(x+22, y, z+34), world(x+22, y, z+34),FillOperation.REPLACE)
    blocks.fill(WHITE_CARPET, world(x+19, y, z+36), world(x+19, y, z+35),FillOperation.REPLACE)
    blocks.fill(WHITE_CARPET, world(x+22, y, z+36), world(x+22, y, z+36),FillOperation.REPLACE)
    blocks.fill(WHITE_CARPET, world(x+20, y, z+37), world(x+21, y, z+37),FillOperation.REPLACE)
    blocks.fill(AIR, world(x, y, z+35), world(x-2, y+1, z+36),FillOperation.REPLACE) #Türen werden gebaut
    blocks.fill(BIRCH_DOOR, world(x-1, y, z+35), world(x-1, y+1, z+36),FillOperation.REPLACE)
    blocks.fill(AIR, world(x+40, y, z+35), world(x+42, y+1, z+36),FillOperation.REPLACE)
    blocks.fill(BIRCH_DOOR, world(x+42, y, z+35), world(x+42, y+1, z+36),FillOperation.REPLACE)
    blocks.fill(WHITE_CONCRETE, world(x+16, y, z+4), world(x+16, y+4, z+4),FillOperation.REPLACE) #Tor Rechts
    blocks.fill(WHITE_CONCRETE, world(x+24, y, z+4), world(x+24, y+4, z+4),FillOperation.REPLACE)
    blocks.fill(WHITE_CONCRETE, world(x+16, y+4, z+4), world(x+24, y+4, z+4),FillOperation.REPLACE)
    blocks.fill(COBWEB, world(x+17, y, z+4), world(x+23, y+3, z+4),FillOperation.REPLACE)
    blocks.fill(WHITE_CONCRETE, world(x+24, y, z+66), world(x+24, y+4, z+66),FillOperation.REPLACE) #tor links
    blocks.fill(WHITE_CONCRETE, world(x+16, y, z+66), world(x+16, y+4, z+66),FillOperation.REPLACE)
    blocks.fill(WHITE_CONCRETE, world(x+16, y+4, z+66), world(x+24, y+4, z+66),FillOperation.REPLACE)
    blocks.fill(COBWEB, world(x+17, y, z+66), world(x+23, y+3, z+66),FillOperation.REPLACE)
    blocks.fill(OAK_FENCE, world(x+2, y, z+3), world(x+2, y, z+67), FillOperation.REPLACE)  # Rechts
    blocks.fill(OAK_FENCE, world(x+38, y, z+3), world(x+38, y, z+67), FillOperation.REPLACE) # Links
    blocks.fill(OAK_FENCE, world(x+3, y, z+2), world(x+37, y, z+2), FillOperation.REPLACE)   # Hinten
    blocks.fill(OAK_FENCE, world(x+3, y, z+68), world(x+37, y, z+68), FillOperation.REPLACE) # Vorne
    blocks.fill(SHROOMLIGHT, world(x-4, y+9, z-3), world(x+45, y+9, z-5), FillOperation.REPLACE)  # Hinten, 2 Blöcke höher
    blocks.fill(SHROOMLIGHT, world(x-4, y+9, z+73), world(x+45, y+9, z+71), FillOperation.REPLACE) # Vorne, 2 Blöcke höher
    blocks.fill(SHROOMLIGHT, world(x-4, y+9, z-3), world(x-5, y+9, z+71), FillOperation.REPLACE)   # Links, längere Beleuchtung
    blocks.fill(SHROOMLIGHT, world(x+45, y+9, z-3), world(x+45, y+9, z+71), FillOperation.REPLACE) # Rechts, längere Beleuchtung
 
    # Eckzäune (4 Ecken extra absichern)
    blocks.place(OAK_FENCE, world(x+2, y, z+2))    # Hinten rechts
    blocks.place(OAK_FENCE, world(x+2, y, z+68))   # Vorne rechts
    blocks.place(OAK_FENCE, world(x+38, y, z+2))   # Hinten links
    blocks.place(OAK_FENCE, world(x+38, y, z+68))  # Vorne links
 
 
def mobspawn(x,y,z):
    for i in range(100):
        mobs.spawn(VILLAGER, world(x+0, y, z+0)), world(x+100, y, Z+1)
    for i in range(100):
        mobs.spawn(VILLAGER, world(x, y, z+50)), world(x+100, y, Z+1)
    for i in range(100):
        mobs.spawn(VILLAGER, world(x, y, z+100)), world(x+100, y, Z+1)
    for i in range (1):
        mobs.spawn(ARMADILLO, world(x+25, y, z+15))
def stadiondach(x, y, z, length, width, height, material): #stadiondach ort wird definiert
    for i in range(radius):
        y_now = y - int(height / radius * i)
        blocks.fill(material, world(x + i, y_now, z + i), world(x + length - i - 1, y_now, z + width - i - 1), FillOperation.REPLACE)
        blocks.fill(AIR, world(x + i + 1, y_now, z + i + 1), world(x + length - i - 2, y_now, z + width - i - 2), FillOperation.REPLACE)
 
    return 1
stadiondach(position[0] - radius, position[1] + radius, position[2] - radius, 40 + 2 * radius, 70 + 2 * radius, 3, 236)
feed(position[0], position[1], position[2])
platz(position[0], position[1], position[2])
mobspawn(position[0], position[1], position[2])

Idee: Im Nachhinein denken wir, dass uns die Arbeit einfacher gefallen wäre, wenn wir ein anderes Element als ein Fussballstadion gewählt hätten. Beispielsweise wenn wir ein Dorf gemacht hätten, hätten wir mit weniger Komplexität verschiedene Häuser bauen können da wir die Grundstruktur eines Codes für ein Haus hätten beibehalten können und nur leichte Veränderungen hätten vornehmen können und so trotzdem ein Vielfältiges Endprodukt erhalten. Zudem hätten wir als erstes prüfen können, wie wir die einzelnen Elemente umsetzen können. Da wir beim Tor sowie auch beim Ball improvisieren mussten da es kein passendes Element gab. Das Tor haben wir also mit Spinnennetz gebaut und den Ball mit einem Tier das auf Eis rutscht was wiederum für die Interaktion ein Problem für uns darstellte.

  • gf2/projekte/2024/minecraft/2d1gruppe1.1743951114.txt.gz
  • Zuletzt geändert: 2025/04/06 16:51
  • von bischofbergere