From 0ea2cb1393964ec8cb1e076f88d9330e3c1f79b3 Mon Sep 17 00:00:00 2001 From: alstergym Date: Thu, 10 Sep 2026 10:15:32 +0200 Subject: [PATCH] 10.09.2026 --- Mario.py | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/Mario.py b/Mario.py index 0a13e17..c2f04f4 100644 --- a/Mario.py +++ b/Mario.py @@ -1,7 +1,8 @@ from Avatar import Avatar from Fahrzeug import Fahrzeug from Items import Items -import time +import time +import random print("Hallo zu meinem Mario Spiel") @@ -65,19 +66,36 @@ print("Start!") print (Spieler.name + " fährt...") -Richtung = input("KREUZUNG! <== == ==>") - - -if Richtung == " <==": - print (Spieler.name + " fährt links") -elif Richtung == " ==": - print (Spieler.name + " fährt geradeaus") -elif Richtung == " ==>": - print (Spieler.name + " fährt rechts") -else: - print (Spieler.name == "VERLOREN!") +running = True +while running == True: + time.sleep (1) + Weg = random.randint(0,1) + if random.randint == 0: + Richtung = input("KREUZUNG! <== == ==>") + if Richtung == " <==": + print (Spieler.name + " fährt links") + elif Richtung == " ==": + print (Spieler.name + " fährt geradeaus") + elif Richtung == " ==>": + print (Spieler.name + " fährt rechts") + else: + print (Spieler.name == "VERLOREN!") + + + if random.randint == 1: + Event = random.randint(0,4) + if random.randint == 0: + print ("Du hast ein Item aufgesammelt!") + elif random.randint == 1: + print ("Ein Quicktime Event") + elif random.randint == 2: + print("Achtung, scharfe Kurve!") + elif random.randint == 3: + print("Du fährst durch eine Grube mit Schlamm") + elif random.randint == 4: + print("Kein Hinderniss, Glück gehabt!")