This commit is contained in:
alstergym
2026-09-10 10:15:28 +02:00
parent f3c6cc72c0
commit bfb909ba3e
2 changed files with 30 additions and 9 deletions
+1
View File
@@ -15,3 +15,4 @@ class Avatar:
print(str(self.fahrzeug)) print(str(self.fahrzeug))
+29 -9
View File
@@ -59,17 +59,37 @@ print("Go!")
print(spieler.name + " fährt...") print(spieler.name + " fährt...")
running = True
while running == True:
time.sleep(1)
event = random.randint(0,1) item = random.randint(1,3)
if item == 1:
item = Stern
elif item == 2:
item = Rakete
elif item == 3:
item = Pilz
item = random.randint(1,3)
if item == 1: event = random.randint(0,1)
item = Stern
elif item == 2:
item = Rakete
elif item == 3:
item = Pilz
print(str(item)) if event == 0:
richtung = input("Kreuzung! Fahre nach links, rechts oder geradeaus: ")
if richtung == "links":
print(spieler.name + " fährt nach links!")
elif richtung == "rechts":
print(spieler.name + " fährt nach rechts!")
elif richtung == "geradeaus":
print(spieler.name + " fährt geradeaus!")
else:
print(spieler.name + " ist aus der Welt gefallen und hat das Spiel verloren.")
running = False
if event == 1:
event = item
print(str(item))
if item.name == "Stern":
print(spieler.name + " überholt drei Gegner!")
elif item.name == ""