From f6858d4726d86cfb961061867092d87945995d3a Mon Sep 17 00:00:00 2001 From: alstergym Date: Mon, 7 Sep 2026 09:56:06 +0200 Subject: [PATCH] a --- Fahrzeug.py | 10 ++++++++++ Mario.py | 33 +++++++++++++++++++++++++++++++++ character.py | 18 ++++++++++++++++++ map.py | 1 + rest.py | 7 +++++++ 5 files changed, 69 insertions(+) create mode 100644 Fahrzeug.py create mode 100644 Mario.py create mode 100644 character.py create mode 100644 map.py create mode 100644 rest.py diff --git a/Fahrzeug.py b/Fahrzeug.py new file mode 100644 index 0000000..48b1125 --- /dev/null +++ b/Fahrzeug.py @@ -0,0 +1,10 @@ +class Fahrzeug: + def __init__(self,name): + self.name = name + + def __str__(self): + return("Es fährt "+self.name ) + + def fahren(self): + print("ich fahre") + diff --git a/Mario.py b/Mario.py new file mode 100644 index 0000000..e53e380 --- /dev/null +++ b/Mario.py @@ -0,0 +1,33 @@ +from Fahrzeug import Fahrzeug +from character import Avatar + +print("Hallo zu unserem Mario Spiel") +mario = Avatar(" Mario") +luigi = Avatar (" Luigi") +Rennwagen = Fahrzeug ("Rennwagen") +Bobbycar = Fahrzeug ("Bobbycar") +Regenbogen = map("Regenbogen") + + + +print(str(mario)) +print(str(luigi)) + +Avatar = input("Wähle deinen character") + +print("Es gibt die Fahrzeuge: Rennwagen, Bobbycar") +fahrzeug=input("Wähle dein Fahrzeug") +mario.fahrzeug_zuweisen(fahrzeug) +print("Du fährst das Fahrzeug") +print(mario.fahrzeug) + +print("Es gibt die Farben: rot, blau") +farbe=input("Wähle deine Helmfarbe") +print("ich habe die helmfarbe") +mario.helmfarbe_zuweisen(farbe) + +print(mario.helmfarbe) + +23 + + diff --git a/character.py b/character.py new file mode 100644 index 0000000..142627b --- /dev/null +++ b/character.py @@ -0,0 +1,18 @@ +class Avatar: + def __init__(self,name): + + + self.name = name + self.helmfarbe = "" + self.items = 0 + self.fahrzeug = "" + + def __str__(self): + return("Ich bin"+ self.name) + + def fahrzeug_zuweisen(self, fahrzeug): + self.fahrzeug = fahrzeug + + def helmfarbe_zuweisen(self, helmfarbe): + self.helmfarbe = helmfarbe + \ No newline at end of file diff --git a/map.py b/map.py new file mode 100644 index 0000000..2cff374 --- /dev/null +++ b/map.py @@ -0,0 +1 @@ +class map: diff --git a/rest.py b/rest.py new file mode 100644 index 0000000..24422b3 --- /dev/null +++ b/rest.py @@ -0,0 +1,7 @@ + +flitzer = Fahrzeug("flitzer") + + + +flitzer.fahren() +mario.fahrzeug_zuweisen(Rennwagen) \ No newline at end of file