This commit is contained in:
alstergym
2026-09-18 09:14:16 +02:00
parent ce085e53eb
commit f98f2fa7ec
14 changed files with 199 additions and 16 deletions
+32
View File
@@ -0,0 +1,32 @@
class Kart:
def __init__ (self, v_max, name, farbe, tempo, drift): #erster Parameter muss self sein #Konstruktor
self.v_max = v_max
self.name = name
self.farbe = farbe
self.tempo = tempo
self.drift = drift
def __str__(self):
return "Das Kart heißt: " + self.name
def beschleunigen(self):
self.tempo = self.tempo + 10
def rammen(self, boom):
self.tempo = self.tempo - self.tempo
boom.tempo = boom.tempo - boom.tempo
class Item:
def __init__ (self, name, tempo):
self.name = name
self.tempo = tempo
self.tempo2 = tempo
def __str__(self):
return "Das Item heißt" + self.name
def stoppen(self):
self.tempo = self.tempo - self.tempo
def boost(self):
self.tempo2 = self.tempo2 *2