Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
| gf2:projekte:2023:minecraft:2d1gruppe1 [2024/01/23 23:57] – decorvetc | gf2:projekte:2023:minecraft:2d1gruppe1 [2024/03/08 21:05] (aktuell) – marroc | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| + | {{ : | ||
| -**Idee:** Zoo mit verschiedenen Bereichen (je nach Tierart) | -**Idee:** Zoo mit verschiedenen Bereichen (je nach Tierart) | ||
| Zeile 17: | Zeile 18: | ||
| - | <code python> | ||
| - | < | ||
| - | **Definition für unsere Eingangshäuschen** | ||
| + | **Definition für unsere Eingangshäuschen** | ||
| + | <code python> | ||
| + | < | ||
| def haus(): | def haus(): | ||
| blocks.fill(PLANKS_DARK_OAK, | blocks.fill(PLANKS_DARK_OAK, | ||
| Zeile 37: | Zeile 38: | ||
| blocks.place(FLOWER_POT, | blocks.place(FLOWER_POT, | ||
| blocks.place(FLOWER_POT, | blocks.place(FLOWER_POT, | ||
| + | </ | ||
| ** | ** | ||
| Definition für unseren Eingangsbereich** | Definition für unseren Eingangsbereich** | ||
| + | <code python> | ||
| def eingang(): | def eingang(): | ||
| blocks.fill(PLANKS_DARK_OAK, | blocks.fill(PLANKS_DARK_OAK, | ||
| Zeile 46: | Zeile 48: | ||
| blocks.fill(PLANKS_OAK, | blocks.fill(PLANKS_OAK, | ||
| blocks.fill(PLANKS_OAK, | blocks.fill(PLANKS_OAK, | ||
| + | </ | ||
| ** | ** | ||
| Definition für unsere Ställe** | Definition für unsere Ställe** | ||
| - | + | <code python> | |
| def hütte(x, | def hütte(x, | ||
| blocks.fill(PLANKS_DARK_OAK, | blocks.fill(PLANKS_DARK_OAK, | ||
| Zeile 56: | Zeile 59: | ||
| blocks.fill(PLANKS_DARK_OAK, | blocks.fill(PLANKS_DARK_OAK, | ||
| blocks.place(DARK_OAK_DOOR, | blocks.place(DARK_OAK_DOOR, | ||
| + | </ | ||
| **Definition für unsere Mauer, welche den Zoo umschliesst** | **Definition für unsere Mauer, welche den Zoo umschliesst** | ||
| + | <code python> | ||
| def mauer(x, | def mauer(x, | ||
| blocks.fill(PLANKS_DARK_OAK, | blocks.fill(PLANKS_DARK_OAK, | ||
| - | + | </ | |
| **Definition für unsere Gehege (Gitter)** | **Definition für unsere Gehege (Gitter)** | ||
| + | <code python> | ||
| def gehege(x, | def gehege(x, | ||
| blocks.fill(IRON_BARS, | blocks.fill(IRON_BARS, | ||
| blocks.fill(IRON_BARS, | blocks.fill(IRON_BARS, | ||
| - | + | </ | |
| **Definition für unsere Gehege (Holzbereich)** | **Definition für unsere Gehege (Holzbereich)** | ||
| + | <code python> | ||
| def zaun(x, | def zaun(x, | ||
| blocks.fill(JUNGLE_FENCE, | blocks.fill(JUNGLE_FENCE, | ||
| blocks.fill(JUNGLE_FENCE, | blocks.fill(JUNGLE_FENCE, | ||
| - | + | </ | |
| **Definition für unsere Voliere** | **Definition für unsere Voliere** | ||
| + | <code python> | ||
| def voliere(x, | def voliere(x, | ||
| blocks.fill(GLASS_PANE, | blocks.fill(GLASS_PANE, | ||
| blocks.fill(GRASS, | blocks.fill(GRASS, | ||
| blocks.fill(GLASS, | blocks.fill(GLASS, | ||
| - | | + | </ |
| **Definition für den Picknickbereich (Tische)** | **Definition für den Picknickbereich (Tische)** | ||
| - | + | <code python> | |
| def tisch(x, | def tisch(x, | ||
| a=0 | a=0 | ||
| Zeile 93: | Zeile 97: | ||
| x=x+1 | x=x+1 | ||
| blocks.place(JUNGLE_SAPLING, | blocks.place(JUNGLE_SAPLING, | ||
| - | | + | </ |
| | | ||
| - | + | <code python> | |
| def spawn(tier, | def spawn(tier, | ||
| agent.teleport(world(x, | agent.teleport(world(x, | ||
| Zeile 104: | Zeile 108: | ||
| agent.place(FORWARD) | agent.place(FORWARD) | ||
| a=a+1 | a=a+1 | ||
| + | </ | ||
| **EIngangsbereich** | **EIngangsbereich** | ||
| + | <code python> | ||
| haus() | haus() | ||
| spawn(SPAWN_VILLAGER, | spawn(SPAWN_VILLAGER, | ||
| Zeile 113: | Zeile 117: | ||
| blocks.print(" | blocks.print(" | ||
| blocks.print(" | blocks.print(" | ||
| + | </ | ||
| **Gittergehege** | **Gittergehege** | ||
| + | <code python> | ||
| gehege(36, | gehege(36, | ||
| gehege(26, | gehege(26, | ||
| gehege(36, | gehege(36, | ||
| gehege(47, -60, -10, -50, 31) | gehege(47, -60, -10, -50, 31) | ||
| + | </ | ||
| **Ställe** | **Ställe** | ||
| + | <code python> | ||
| hütte(53, | hütte(53, | ||
| hütte(53, | hütte(53, | ||
| hütte(53, | hütte(53, | ||
| hütte(85, | hütte(85, | ||
| - | + | </ | |
| **Holzzäune** | **Holzzäune** | ||
| + | <code python> | ||
| zaun(0, | zaun(0, | ||
| zaun(-14, | zaun(-14, | ||
| Zeile 132: | Zeile 140: | ||
| zaun(-14, | zaun(-14, | ||
| zaun(0, | zaun(0, | ||
| - | + | </ | |
| **Umrandung** | **Umrandung** | ||
| + | <code python> | ||
| mauer(2, | mauer(2, | ||
| mauer(-29, | mauer(-29, | ||
| Zeile 141: | Zeile 150: | ||
| mauer(89, | mauer(89, | ||
| mauer(53, | mauer(53, | ||
| - | mauer(54, | + | mauer(54, |
| mauer(89, -60, -61, 0, -42) | mauer(89, -60, -61, 0, -42) | ||
| mauer(46, | mauer(46, | ||
| mauer(15, | mauer(15, | ||
| - | mauer(85, | + | mauer(85, |
| + | </ | ||
| **Mitarbeitertür** | **Mitarbeitertür** | ||
| + | <code python> | ||
| blocks.fill(AIR, | blocks.fill(AIR, | ||
| blocks.place(OAK_DOOR, | blocks.place(OAK_DOOR, | ||
| + | </ | ||
| **Papageienhaus** | **Papageienhaus** | ||
| + | <code python> | ||
| voliere(-2, | voliere(-2, | ||
| - | + | </ | |
| **Aquarium** | **Aquarium** | ||
| - | + | <code python> | |
| blocks.fill(BLACKSTONE, | blocks.fill(BLACKSTONE, | ||
| blocks.fill(SAND, | blocks.fill(SAND, | ||
| blocks.fill(AIR, | blocks.fill(AIR, | ||
| - | + | ||
| blocks.fill(GLASS_PANE, | blocks.fill(GLASS_PANE, | ||
| Zeile 173: | Zeile 184: | ||
| blocks.fill(GLASS_PANE, | blocks.fill(GLASS_PANE, | ||
| blocks.fill(GLASS_PANE, | blocks.fill(GLASS_PANE, | ||
| - | + | </ | |
| **Dach des weges** | **Dach des weges** | ||
| + | <code python> | ||
| blocks.fill(GLASS, | blocks.fill(GLASS, | ||
| blocks.fill(GLASS, | blocks.fill(GLASS, | ||
| blocks.fill(GLASS, | blocks.fill(GLASS, | ||
| blocks.fill(GLASS, | blocks.fill(GLASS, | ||
| - | + | </ | |
| **Boden des Weges** | **Boden des Weges** | ||
| + | <code python> | ||
| blocks.fill(PRISMARINE, | blocks.fill(PRISMARINE, | ||
| blocks.fill(PRISMARINE, | blocks.fill(PRISMARINE, | ||
| Zeile 191: | Zeile 204: | ||
| blocks.print(" | blocks.print(" | ||
| - | + | </ | |
| - | + | **Picknickbbereich** | |
| + | <code python> | ||
| tisch(20, | tisch(20, | ||
| tisch(20, | tisch(20, | ||
| Zeile 213: | Zeile 227: | ||
| tisch(30, | tisch(30, | ||
| + | </ | ||
| **Tiere** | **Tiere** | ||
| - | + | <code python> | |
| - | + | ||
| spawn(SPAWN_PARROT, | spawn(SPAWN_PARROT, | ||
| spawn(SPAWN_PANDA, | spawn(SPAWN_PANDA, | ||
| Zeile 228: | Zeile 241: | ||
| spawn(SPAWN_PIG, | spawn(SPAWN_PIG, | ||
| spawn(SPAWN_TROPICAL_FISH, | spawn(SPAWN_TROPICAL_FISH, | ||
| - | spawn(SPAWN_PUFFERFISH, | ||
| spawn(SPAWN_SALMON, | spawn(SPAWN_SALMON, | ||
| spawn(SPAWN_DOLPHIN, | spawn(SPAWN_DOLPHIN, | ||
| Zeile 234: | Zeile 246: | ||
| spawn(SPAWN_SQUID, | spawn(SPAWN_SQUID, | ||
| spawn(SPAWN_GLOW_SQUID, | spawn(SPAWN_GLOW_SQUID, | ||
| - | spawn(SPAWN_AXOLOTL, | + | </ |
| **Bäume** | **Bäume** | ||
| + | <code python> | ||
| blocks.place(BAMBOO, | blocks.place(BAMBOO, | ||
| blocks.place(BAMBOO, | blocks.place(BAMBOO, | ||
| Zeile 256: | Zeile 268: | ||
| blocks.place(CHERRY_SAPLING, | blocks.place(CHERRY_SAPLING, | ||
| blocks.place(CHERRY_SAPLING, | blocks.place(CHERRY_SAPLING, | ||
| + | </ | ||
| **Dies ist unser zweiter Teil unseres Projektes. Das ist der Interaktive Teil, welche unseren Eingangsbereich, | **Dies ist unser zweiter Teil unseres Projektes. Das ist der Interaktive Teil, welche unseren Eingangsbereich, | ||
| + | <code python> | ||
| # Die folgende Funktion testet, ob ein Gold Klumpen in der Truhe ist. | # Die folgende Funktion testet, ob ein Gold Klumpen in der Truhe ist. | ||
| Zeile 265: | Zeile 277: | ||
| def isGoldinChest(x, | def isGoldinChest(x, | ||
| - | |||
| blocks.fill(CHEST, | blocks.fill(CHEST, | ||
| goldFound = False | goldFound = False | ||
| Zeile 272: | Zeile 283: | ||
| agent.teleport(world(50, | agent.teleport(world(50, | ||
| - | |||
| agent.drop_all(FORWARD) | agent.drop_all(FORWARD) | ||
| Zeile 280: | Zeile 290: | ||
| # Agenten zur Kiste teleportieren | # Agenten zur Kiste teleportieren | ||
| - | + | | |
| - | | + | |
| # Kiste zerstören und Objekte aufsammeln | # Kiste zerstören und Objekte aufsammeln | ||
| agent.destroy(FORWARD) | agent.destroy(FORWARD) | ||
| - | |||
| agent.collect_all() | agent.collect_all() | ||
| - | | ||
| - | blocks.fill(CHEST, | ||
| - | |||
| for slotNumber in range(1, | for slotNumber in range(1, | ||
| - | |||
| itemID = agent.get_item_detail(slotNumber) | itemID = agent.get_item_detail(slotNumber) | ||
| - | |||
| if (itemID == 371): | if (itemID == 371): | ||
| - | |||
| goldFound = True | goldFound = True | ||
| - | |||
| return goldFound | return goldFound | ||
| Zeile 306: | Zeile 307: | ||
| | | ||
| - | |||
| | | ||
| - | |||
| # Agent weit weg teleportieren und alles wegschmeissen | # Agent weit weg teleportieren und alles wegschmeissen | ||
| | | ||
| - | |||
| | | ||
| Zeile 320: | Zeile 318: | ||
| # Agenten zur Kiste teleportieren | # Agenten zur Kiste teleportieren | ||
| - | + | agent.teleport(world(a, b, c+1), NORTH) | |
| - | agent.teleport(world(x, y, z+1), NORTH) | + | |
| # Kiste zerstören und Objekte aufsammeln | # Kiste zerstören und Objekte aufsammeln | ||
| - | |||
| | | ||
| - | |||
| | | ||
| | | ||
| - | |||
| for slotNumber in range(1, | for slotNumber in range(1, | ||
| - | |||
| | | ||
| - | |||
| if (itemID == 371): | if (itemID == 371): | ||
| - | |||
| | | ||
| - | |||
| | | ||
| Zeile 346: | Zeile 336: | ||
| player.execute("/ | player.execute("/ | ||
| - | # Definition dafür | + | # Definition dafür |
| def giveNightVisionPotion(x, | def giveNightVisionPotion(x, | ||
| for k in range(1): | for k in range(1): | ||
| Zeile 357: | Zeile 347: | ||
| def on_forever(): | def on_forever(): | ||
| - | |||
| if (isGoldinChest(8, | if (isGoldinChest(8, | ||
| - | |||
| player.say(" | player.say(" | ||
| - | |||
| replaceSlotsinChestAir(8, | replaceSlotsinChestAir(8, | ||
| - | |||
| for i in range(4): | for i in range(4): | ||
| - | |||
| for j in range(3): | for j in range(3): | ||
| blocks.fill(AIR, | blocks.fill(AIR, | ||
| - | |||
| else: | else: | ||
| - | |||
| for i in range(4): | for i in range(4): | ||
| - | |||
| for j in range(3): | for j in range(3): | ||
| - | |||
| blocks.fill(BLOCK_OF_STRIPPED_BAMBOO, | blocks.fill(BLOCK_OF_STRIPPED_BAMBOO, | ||
| - | | ||
| loops.pause(1000) | loops.pause(1000) | ||
| | | ||
| def on_forever2(): | def on_forever2(): | ||
| - | |||
| if (isGoldinChest(18, | if (isGoldinChest(18, | ||
| - | |||
| player.say(" | player.say(" | ||
| - | + | | |
| - | | + | |
| - | + | ||
| for i in range(6): | for i in range(6): | ||
| - | |||
| for j in range(3): | for j in range(3): | ||
| - | | ||
| blocks.fill(AIR, | blocks.fill(AIR, | ||
| - | |||
| else: | else: | ||
| - | |||
| for i in range(6): | for i in range(6): | ||
| - | |||
| for j in range(3): | for j in range(3): | ||
| - | | ||
| blocks.fill(BLOCK_OF_STRIPPED_BAMBOO, | blocks.fill(BLOCK_OF_STRIPPED_BAMBOO, | ||
| - | |||
| loops.pause(1000) | loops.pause(1000) | ||
| def on_forever3(): | def on_forever3(): | ||
| if (Payforpotion(9, | if (Payforpotion(9, | ||
| - | |||
| player.say(" | player.say(" | ||
| - | |||
| giveNightVisionPotion(9, | giveNightVisionPotion(9, | ||
| - | | ||
| else: | else: | ||
| replaceSlotsinChestAir(9, | replaceSlotsinChestAir(9, | ||
| - | | ||
| - | | ||
| loops.pause(1000) | loops.pause(1000) | ||
| Zeile 423: | Zeile 387: | ||
| loops.forever(on_forever4) | loops.forever(on_forever4) | ||
| | | ||
| + | </ | ||