18.09.26
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
||||
from kart import Kart
|
||||
from kart import Item
|
||||
|
||||
#Definition der Karts/Erzeugung des Objekts
|
||||
kart1 = Kart(300, "bluey", "blue", 120, 200)
|
||||
print(kart1)
|
||||
print(kart1.farbe)
|
||||
kart1.beschleunigen()
|
||||
print(kart1.tempo)
|
||||
print(kart1.drift)
|
||||
|
||||
kart2 = Kart(500, "lene", "rosa", 320, 200)
|
||||
print(kart2)
|
||||
print(kart2.farbe)
|
||||
kart2.beschleunigen()
|
||||
print(kart2.tempo)
|
||||
print(kart2.drift)
|
||||
|
||||
#Interaktion zweier Objekte kart1 & kart2
|
||||
kart1.rammen(kart2)
|
||||
|
||||
print(kart1.tempo)
|
||||
print(kart2.tempo)
|
||||
|
||||
item1 = Item("Stopp", 120)
|
||||
print(item1.name)
|
||||
item1.stoppen()
|
||||
print(item1.tempo)
|
||||
|
||||
item1.boost()
|
||||
print(item1.tempo2)
|
||||
Reference in New Issue
Block a user