SubwaySurfer Lite
Modul.py — Python Source, 27 KB (28054 bytes)
Dateiinhalt
# -*- coding: utf-8 -*- from visual import * from math import sin,cos from time import time scene.background=(0,0.1,0) scene.forward=(0,-450,-300) scene.userspin = False scene.userzoom = True ModulList=[] A=0 B=0 C=0 D=0 #Test = box(pos = (0,0,0), length = 100,width=100, height=100) Spielstopp = False Score=label(pos=(150,200,0), text='Score') Boden= box(pos=(0,0,0), length=1200, width=200, height=1,) class Spieler (frame): def __init__ (self, position =(0,0,0)): frame. __init__ (self) self.oberkoerper = box(frame=self, pos=(0,0,0),length=50, width=20, height=65, color= color.red) self.kopf = box(frame=self, pos=(0,47.5,0), length=25, width=25, height=25, color=color.green) self.hals = box(frame=self, pos=(0,35,0), length=10, width=10, height=5, color=color.yellow) self.arm1 = box(frame=self, pos=(33.5,-5,0), length=15, width=20, height=75, color=color.blue,) self.arm2 = box(frame=self, pos=(-33.5,-5,0), length=15, width=20, height=75, color=color.blue) self.bein2 =box(frame=self, pos=(-12.5,-77.5,0), length=20, width=20, height=90, color=color.orange) self.bein1 =box(frame=self, pos=(12.5,-77.5,0), length=20, width=20, height=90, color=color.orange) self.arm1.rotate( angle=-pi/8, axis=(1,0,0), origin=(0,30,0)) self.arm2.rotate( angle=pi/8, axis=(1,0,0), origin=(0,30,0)) self.bein1.rotate( angle=pi/8, axis=(1,0,0), origin=(0,-30,0)) self.bein2.rotate( angle=-pi/8, axis=(1,0,0), origin=(0,-30,0)) self.pos = position #scene.center = Spieler.pos class Waggon1(frame): def __init__(self,position): frame.__init__(self) self.rightSide = box(frame = self, pos = (150,228.5,0), length = 50, width = 1200, height = 325, color = color.blue) self.leftSide = box(frame = self, pos = (-150,228.5,0), length = 50, width = 1200, height = 325, color = color.blue) self.topSide = box(frame = self, pos = (0,415,0), length = 250, width = 1200, height = 50,color = color.yellow) self.botSide = box(frame = self, pos = (0,215,0), length = 300, width = 1200, height = 350,color = color.blue) self.topLeft = cylinder(frame = self, pos = (-125,390,-599.5), axis = (0,0,1199),radius = 50,color = color.yellow) self.topRight = cylinder(frame = self, pos = (125,390,-599.5), axis = (0,0,1199),radius = 50,color = color.yellow) self.botRight = cylinder(frame = self, pos = (150,65,-599.5), axis = (0,0,1199),radius = 25,color = color.yellow) self.botLeft = cylinder(frame = self, pos = (-150,65,-599.5), axis = (0,0,1199),radius = 25,color = color.yellow) self.Whee11 = cylinder(frame = self, pos = (-140,40,510), axis = (15,0,0),radius = 40,color = (0.4,0.3,0.3)) self.Whee12 = cylinder(frame = self, pos = (-140,40,350), axis = (15,0,0),radius = 40,color = (0.4,0.3,0.3)) self.Whee13 = cylinder(frame = self, pos = (-140,40,-510), axis = (15,0,0),radius = 40,color = (0.4,0.3,0.3)) self.Whee14 = cylinder(frame = self, pos = (-140,40,-350), axis = (15,0,0),radius = 40,color = (0.4,0.3,0.3)) self.Whee15 = cylinder(frame = self, pos = (140,40,510), axis = (15,0,0),radius = 40,color = (0.4,0.3,0.3)) self.Whee16 = cylinder(frame = self, pos = (140,40,350), axis = (15,0,0),radius = 40,color = (0.4,0.3,0.3)) self.Whee17 = cylinder(frame = self, pos = (140,40,-510), axis = (15,0,0),radius = 40,color = (0.4,0.3,0.3)) self.Whee18 = cylinder(frame = self, pos = (140,40,-350), axis = (15,0,0),radius = 40,color = (0.4,0.3,0.3)) self.kuplung1 = cylinder(frame = self, pos = (80,85,-625), axis = (0,0,25),radius = 15) self.kuplung2 = cylinder(frame = self, pos = (80,85,-635), axis = (0,0,10),radius = 30) self.kuplung1 = cylinder(frame = self, pos = (-80,85,600), axis = (0,0,25),radius = 15) self.kuplung2 = cylinder(frame = self, pos = (-80,85,625), axis = (0,0,10),radius = 30) self.kuplung3 = cylinder(frame = self, pos = (-80,85,-625), axis = (0,0,25),radius = 15) self.kuplung4 = cylinder(frame = self, pos = (-80,85,-635), axis = (0,0,10),radius = 30) self.kuplung3 = cylinder(frame = self, pos = (80,85,600), axis = (0,0,25),radius = 15) self.kuplung4 = cylinder(frame = self, pos = (80,85,625), axis = (0,0,10),radius = 30) self.pos = position class Lokomotive1(frame): def __init__(self,position): frame.__init__(self) self.rightSide = box(frame = self, pos = (150,228.5,0), length = 50, width = 800, height = 325,color = (0.2,0.2,0.2)) self.leftSide = box(frame = self, pos = (-150,228.5,0), length = 50, width = 800, height = 325,color = (0.2,0.2,0.2)) self.topSide = box(frame = self, pos = (0,415,0), length = 250, width = 800, height = 50,color = (0.2,0.2,0.2)) self.botSide = box(frame = self, pos = (0,215,0), length = 300, width = 800, height = 350,color = (0.2,0.2,0.2)) self.topLeft = cylinder(frame = self, pos = (-125,390,-399.5), axis = (0,0,799),radius = 50,color = (0.4,0.4,0.4)) self.topRight = cylinder(frame = self, pos = (125,390,-399.5), axis = (0,0,799),radius = 50,color = (0.4,0.4,0.4)) self.botRight = cylinder(frame = self, pos = (150,65,-399.5), axis = (0,0,799),radius = 25,color = (0.4,0.4,0.4)) self.botLeft = cylinder(frame = self, pos = (-150,65,-399.5), axis = (0,0,799),radius = 25,color = (0.4,0.4,0.4)) self.Whee11 = cylinder(frame = self, pos = (-140,40,230), axis = (15,0,0),radius = 40,color = (0.4,0.3,0.3)) self.Whee12 = cylinder(frame = self, pos = (-140,40,330), axis = (15,0,0),radius = 40,color = (0.4,0.3,0.3)) self.Whee13 = cylinder(frame = self, pos = (-140,40,-230), axis = (15,0,0),radius = 40,color = (0.4,0.3,0.3)) self.Whee14 = cylinder(frame = self, pos = (-140,40,-330), axis = (15,0,0),radius = 40,color = (0.4,0.3,0.3)) self.Whee15 = cylinder(frame = self, pos = (140,40,230), axis = (15,0,0),radius = 40,color = (0.4,0.3,0.3)) self.Whee16 = cylinder(frame = self, pos = (140,40,330), axis = (15,0,0),radius = 40,color = (0.4,0.3,0.3)) self.Whee17 = cylinder(frame = self, pos = (140,40,-230), axis = (15,0,0),radius = 40,color = (0.4,0.3,0.3)) self.Whee18 = cylinder(frame = self, pos = (140,40,-330), axis = (15,0,0),radius = 40,color = (0.4,0.3,0.3)) self.Whee19 = cylinder(frame = self, pos = (140,40,130), axis = (15,0,0),radius = 40,color = (0.4,0.3,0.3)) self.Whee110 = cylinder(frame = self, pos = (140,40,-130), axis = (15,0,0),radius = 40,color = (0.4,0.3,0.3)) self.Whee111 = cylinder(frame = self, pos = (-140,40,130), axis = (15,0,0),radius = 40,color = (0.4,0.3,0.3)) self.Whee112 = cylinder(frame = self, pos = (-140,40,-130), axis = (15,0,0),radius = 40,color = (0.4,0.3,0.3)) self.Window = box(frame = self, pos = (0,310,400), length = 250, width = 10, height = 140,color = (0.7,0.7,1)) self.Lampe = cylinder(frame = self, pos = (95,125,401), axis = (0,0,-10),radius = 30, material = materials.emissive, color = color.yellow) self.Lampe = cylinder(frame = self, pos = (-95,125,401), axis = (0,0,-10),radius = 30, material = materials.emissive, color = color.yellow) self.kuplung1 = cylinder(frame = self, pos = (80,85,-425), axis = (0,0,25),radius = 15) self.kuplung2 = cylinder(frame = self, pos = (80,85,-435), axis = (0,0,10),radius = 30) self.kuplung3 = cylinder(frame = self, pos = (-80,85,-425), axis = (0,0,25),radius = 15) self.kuplung4 = cylinder(frame = self, pos = (-80,85,-435), axis = (0,0,10),radius = 30) #self.spoiler = pyramid(frame = self, pos = (0,50,340), size = (100,300,200),axis = (0,1,0)) #self.spoiler.rotate(angle=pi/4 , axis = (0,1,0), origin=(0,50,340)) self.pos = position class Sourounding(frame): def __init__(self,position=(0,0,0)): frame.__init__(self) floor=box(frame = self, length = 1700, width = 22300, height = 1) self.Schiene1 = box(frame = self, pos = (-590+7.5,5,0), length = 8, width = 22300, height = 10, color = (0.3,0.3,0.3)) self.Schiene2 = box(frame = self, pos = (-310+7.5,5,0), length = 8, width = 22300, height = 10, color = (0.3,0.3,0.3)) self.Schiene3 = box(frame = self, pos = (-140+7.5,5,0), length = 8, width = 22300, height = 10, color = (0.3,0.3,0.3)) self.Schiene4 = box(frame = self, pos = (140+7.5,5,0), length = 8, width = 22300, height = 10, color = (0.3,0.3,0.3)) self.Schiene5 = box(frame = self, pos = (310+7.5,5,0), length = 8, width = 22300, height = 10, color = (0.3,0.3,0.3)) self.Schiene6 = box(frame = self, pos = (590+7.5,5,0), length = 8, width = 22300, height = 10, color = (0.3,0.3,0.3)) self.rightWall = box (frame = self, pos = (750,1000,0), length = 100, width = 22300, height = 2000) self.leftWall = box (frame = self, pos = (-750,1000,0), length = 100, width = 22300, height = 2000) self.rightWall = box (frame = self,pos = (0,1000,-3000), length = 1600, width = 100, height = 2000) self.Tunnel1 = box (frame = self,pos = (0,230,-3000), length = 420, width = 101, height = 460,color = color.black) self.Tunnel1 = box (frame = self,pos = (-450,230,-3000), length = 420, width = 101, height = 460,color = color.black) self.Tunnel1 = box (frame = self,pos = (450,230,-3000), length = 420, width = 101, height = 460,color = color.black) self.Tunneltop1 = cylinder(frame = self,pos = (450,460,-3000), radius = 210, axis=(0,0,101),color = color.black) self.Tunneltop1 = cylinder(frame = self,pos = (-450,460,-3000), radius = 210, axis=(0,0,101),color = color.black) self.Tunneltop1 = cylinder(frame = self,pos = (0,460,-3000), radius = 210, axis=(0,0,101),color = color.black) self.pos = position """ #Züge Mittes Zugm3 = Lokomotive1(position=(0,0,1070)), Waggon1(position=(0,0,0)), Waggon1(position=(0,0,-1270)), Waggon1(position=(0,0,-2540)) Zugm2 = Lokomotive1(position=(0,0,1070)), Waggon1(position=(0,0,0)), Waggon1(position=(0,0,-1270)) Zugm1 = Lokomotive1(position=(0,0,1070)), Waggon1(position=(0,0,0)) ZugLockonly = Lokomotive1(position=(0,0,1070)) """ """ #Züge left Zugm3 = Lokomotive1(position=(-450,0,1070)), Waggon1(position=(-450,0,0)), Waggon1(position=(-450,0,-1270)), Waggon1(position=(-450,0,-2540)) Zugm2 = Lokomotive1(position=(-450,0,1070)), Waggon1(position=(-450,0,0)), Waggon1(position=(-450,0,-1270)) Zugm1 = Lokomotive1(position=(-450,0,1070)), Waggon1(position=(-450,0,0)) ZugLockonly = Lokomotive1(position=(-450,0,1070)) """ """ #Züge right Zugr3 = Lokomotive1(position=(450,0,1070)), Waggon1(position=(450,0,0)), Waggon1(position=(450,0,-1270)), Waggon1(position=(450,0,-2540)) Zugr2 = Lokomotive1(position=(450,0,1070)), Waggon1(position=(450,0,0)), Waggon1(position=(450,0,-1270)) Zugr1 = Lokomotive1(position=(450,0,1070)), Waggon1(position=(450,0,0)) ZugLockonly = Lokomotive1(position=(450,0,1070)) """ class Zug0(frame): def __init__(self,position=(0,0,0)): frame.__init__(self) self.ZugLockonly = Waggon1(position=(0,10,1070-1470)) self.ZugLockonly.frame = self self.pos = position class Zug1(frame): def __init__(self,position=(0,0,0)): frame.__init__(self) self.Zugm1 = Lokomotive1( position=(0,10,-400)) self.Zugm1.frame = self self.w1 = Waggon1(position=(0,10,-1470)) self.w1.frame = self self.pos = position class Zug2(frame): def __init__(self,position=(0,0,0)): frame.__init__(self) self.Zugm2 = Lokomotive1(position=(0,10,-400)) self.Zugm2.frame = self self.w1 = Waggon1(position=(0,10,-1470)) self.w1.frame = self self.w2 = Waggon1(position=(0,10,-2740)) self.w2.frame = self self.pos = position class Zug3(frame): def __init__(self,position=(0,0,0)): frame.__init__(self) self.Zugm3 = Lokomotive1(position=(0,10,-400)) self.Zugm3.frame = self self.w1 = Waggon1(position=(0,10,-1470)) self.w1.frame = self self.w2 = Waggon1(position=( 0,10,-1270-1470)) self.w2.frame = self self.w3 = Waggon1(position=( 0,10,-2540-1470)) self.w3.frame = self self.pos = position """ class ZuglWaggononly(frame): def __init__(self,position=(0,0,0)): frame.__init__(self) self.ZugLockonly = Waggon1(position=(-450,10,1070-1470)) self.pos = position class Zugl1(frame): def __init__(self,position=(0,0,0)): frame.__init__(self) self.Zugm1 = Lokomotive1(position=(-450,10,-400)) self.w1 = Waggon1(position=(-450,10,-1470)) self.pos = position class Zugl2(frame): def __init__(self,position=(0,0,0)): frame.__init__(self) Zugm2 = Lokomotive1(position=(-450,10,-400)) self.wag1 = Waggon1(position=(-450,10,-1470)) self.wag2 = Waggon1(position=(-450,10,-1270-1470)) self.pos = position class Zugl3(frame): def __init__(self,position=(0,0,0)): frame.__init__(self) self.Zugm3 = Lokomotive1(position=(-450,10,-400)) self.w1 = Waggon1(position=(-450,10,-1470)) self.w2 = Waggon1(position=(-450,10,-1270-1470)) self.w3 = Waggon1(position=(-450,10,-2540-1470)) self.pos = position class ZugrWaggononly(frame): def __init__(self,position=(0,0,0)): frame.__init__(self) self.Wag = Waggon1(position=(450,10,1070-1470)) self.pos = position class Zugr1(frame): def __init__(self,position=(0,0,0)): frame.__init__(self) self.Zugm1 = Lokomotive1(position=(450,10,-400)) self.wag1 = Waggon1(position=(450,10,-1470)) self.pos = position class Zugr2(frame): def __init__(self,position=(0,0,0)): frame.__init__(self) self.Zugm2 = Lokomotive1(position=(450,10,-400)) self.wag1 = Waggon1(position=(450,10,-1470)) self.wag2 = Waggon1(position=(450,10,-1270-1470)) self.pos = position s class Zugr3(frame): def __init__(self,position=(0,0,0)): frame.__init__(self) self.Zugm3 = Lokomotive1(position=(450,10,-400)) self.Zugm3.frame = self self.w1 = Waggon1(position=(450,10,-1470)) self.w2 = Waggon1(position=(450,10,-1270-1470)) self.w3 = Waggon1(position=(450,10,-2540-1470)) self.pos = position """ class Modul1(frame): def __init__(self,position): frame.__init__(self) self.Zug =[] Infos1={"Stelle":"l","StartPos":-1270,"Laenge":3375} Infos2={"Stelle":"l","StartPos":-8890,"Laenge":3375} Infos3={"Stelle":"m","StartPos":-2540,"Laenge":1270} Infos4={"Stelle":"m","StartPos":-6350,"Laenge":1270} Infos5={"Stelle":"r","StartPos":-5080,"Laenge":3375} Infos6={"Stelle":"r","StartPos":-10160,"Laenge":2105} self.Z1 = Zug2(position = (-450,0,-1270)) self.Z1.frame = self self.Zug.append(Infos1) self.Z2 = Zug2(position = (-450,0,-8890)) self.Z2.frame = self self.Zug.append(Infos2) self.Z3 = Zug0(position = (0,0,-2540)) self.Z3.frame = self self.Zug.append(Infos3) self.Z4 = Zug0(position = (0,0,-6350)) self.Z4.frame = self self.Zug.append(Infos4) self.Z5 = Zug2(position = (450,0,-5080)) self.Z5.frame = self self.Zug.append(Infos5) self.Z6 = Zug1(position = (450,0,-10160)) self.Z6.frame = self self.Zug.append(Infos6) self.pos = position class Modul2(frame): def __init__(self,position): frame.__init__(self) self.Zug =[] Infos1={"Stelle":"l","StartPos":-1270,"Laenge":2105} Infos2={"Stelle":"r","StartPos":-1270,"Laenge":2105} Infos3={"Stelle":"m","StartPos":-5080,"Laenge":3375} Infos4={"Stelle":"l","StartPos":-10160,"Laenge":2105} self.Z1 = Zug1(position = (-450,0,-1270)) self.Z1.frame = self self.Zug.append(Infos1) self.Z2 = Zug1(position = (450,0,-1270)) self.Z2.frame = self self.Zug.append(Infos2) self.Z3 = Zug2(position = (0,0,-5080)) self.Z3.frame = self self.Zug.append(Infos3) self.Z4 = Zug1(position = (-450,0,-10160)) self.Z4.frame = self self.Zug.append(Infos4) self.pos = position class Modul3(frame): def __init__(self,position): frame.__init__(self) self.Zug =[] Infos1={"Stelle":"r","StartPos":-1270,"Laenge":2105} Infos2={"Stelle":"l","StartPos":-3810,"Laenge":3375} Infos3={"Stelle":"l","StartPos":-7620,"Laenge":4645} Infos4={"Stelle":"m","StartPos":-6350,"Laenge":2105} Infos5={"Stelle":"r","StartPos":-11430,"Laenge":1270} self.Z1 = Zug1(position = (450,0,-1270)) self.Z1.frame = self self.Zug.append(Infos1) self.Z2 = Zug2(position = (-450,0,-3810)) self.Z2.frame = self self.Zug.append(Infos2) self.Z3 = Zug3(position = (-450,0,-7620)) self.Z3.frame = self self.Zug.append(Infos3) self.Z4 = Zug1(position = (0,0,-6350)) self.Z4.frame = self self.Zug.append(Infos4) self.Z5 = Zug0(position = (450,0,-11430)) self.Z5.frame = self self.Zug.append(Infos5) self.pos = position class Modul4(frame): def __init__(self,position): frame.__init__(self) self.Zug =[] Infos1={"Stelle":"l","StartPos":-1270,"Laenge":2105} Infos2={"Stelle":"m","StartPos":-3810,"Laenge":2105} Infos3={"Stelle":"m","StartPos":-7620,"Laenge":1270} Infos4={"Stelle":"l","StartPos":-10160,"Laenge":2105} Infos5={"Stelle":"r","StartPos":-1270,"Laenge":1270} Infos6={"Stelle":"r","StartPos":-8890,"Laenge":2105} self.Z1 = Zug1(position = (-450,0,-1270)) self.Z1.frame = self self.Zug.append(Infos1) self.Z2 = Zug1(position = (0,0,-3810)) self.Z2.frame = self self.Zug.append(Infos2) self.Z3 = Zug0(position = (0,0,-7620)) self.Z3.frame = self self.Zug.append(Infos3) self.Z4 = Zug1(position = (-450,0,-10160)) self.Z4.frame = self self.Zug.append(Infos4) self.Z5 = Zug0(position = (450,0,-1270)) self.Z5.frame = self self.Zug.append(Infos5) self.Z6 = Zug1(position = (450,0,-8890)) self.Z6.frame = self self.Zug.append(Infos6) self.pos = position class Modul5(frame): def __init__(self,position): frame.__init__(self) self.Zug =[] Infos1={"Stelle":"l","StartPos":-1270,"Laenge":4645} Infos2={"Stelle":"m","StartPos":-1270,"Laenge":3375} Infos3={"Stelle":"m","StartPos":-7620,"Laenge":2405} Infos4={"Stelle":"m","StartPos":-11430,"Laenge":1270} Infos5={"Stelle":"r","StartPos":-11430,"Laenge":1270} self.Z1 = Zug3(position = (-450,0,-1270)) self.Z1.frame = self self.Zug.append(Infos1) self.Z2 = Zug2(position = (0,0,-1270)) self.Z2.frame = self self.Zug.append(Infos2) self.Z3 = Zug1(position = (0,0,-7620)) self.Z3.frame = self self.Zug.append(Infos3) self.Z4 = Zug0(position = (0,0,-11430)) self.Z4.frame = self self.Zug.append(Infos4) self.Z5 = Zug0(position = (450,0,-11430)) self.Z5.frame = self self.Zug.append(Infos5) self.pos = position #ModulList.append(Modul1(position = (0,0,0))) #ModulList.append(Modul2(position = (0,0,0))) #ModulList.append(Modul3(position = (0,0,0))) #ModulList.append(Modul4(position = (0,0,0))) #ModulList.append(Modul5(position = (0,0,0))) #Player = box(length = 100, width = 1, height = 180,pos=(0,90,0)) def Bewegen(Spieler): i = 5 global A global B global C global D global mytext P = False b = True adden(1) while True: #print(C) if C == 254: C = 0 x = random.randint(1,5) adden(x) Testen(Spieler) rate(15) if scene.kb.keys: zeichen = scene.kb.getkey() print (zeichen) if zeichen == "a": if Spieler.pos == (0,120,0): Spieler.pos =(-450,120,0) elif Spieler.pos == (450,120,0): Spieler.pos = (0,120,0) elif zeichen =="d": if Spieler.pos == (-450,120,0): Spieler.pos=(0,120,0) elif Spieler.pos == (0,120,0): Spieler.pos = (450,120,0) elif zeichen=="p": if P == False: Pause=label(pos=(0,0,0), text='Pause \nPress "ESC" To Exit\nPress "C" To Continue') P=True print (str (P)) elif zeichen=="c": if P == True: Pause.visible=false del Pause P = False print(str(P)) elif zeichen=="esc": exit() rate(150) if b == true: Spieler.arm1.rotate( angle=-0.1, axis=(1,0,0), origin=(0,30,0)) Spieler.arm2.rotate( angle=0.1, axis=(1,0,0), origin=(0,30,0)) Spieler.bein1.rotate( angle=0.1, axis=(1,0,0), origin=(0,-30,0)) Spieler.bein2.rotate( angle=-0.1, axis=(1,0,0), origin=(0,-30,0)) A = A+1 Score.text = str(A) i= i-1 #print(i) #print(A) if i < -3: #print("Eins") b = false else: Spieler.arm1.rotate( angle=0.1, axis=(1,0,0), origin=(0,30,0)) Spieler.arm2.rotate( angle=-0.1, axis=(1,0,0), origin=(0,30,0)) Spieler.bein1.rotate( angle=-0.1, axis=(1,0,0), origin=(0,-30,0)) Spieler.bein2.rotate( angle=0.1, axis=(1,0,0), origin=(0,-30,0)) i = i+1 A = A+1 Score.text = str(A) #print(i) #print(A) if i > 20: #print("Zwei") b = true i = 0 while True: #print(i) if i < len(ModulList): #print(D,i) ModulList[i].pos = (ModulList[i].x,ModulList[i].y,ModulList[i].z+50) B = B+1 C = C+1 if ModulList[i].z == 13000: ModulList[i].visible = False del(ModulList[i]) else: i = i+1 else: break def Testen(Spieler): global B for i in range(len(ModulList)): for o in range(len(ModulList[i].Zug)): #print (ModulList[i].Zug[o]["StartPos"]+B*50) #print (ModulList[i].Zug[o]["Laenge"]) #print(i,o,B) if ModulList[i].Zug[o]["Stelle"] == "l": #print("Links") if ModulList[i].Zug[o]["StartPos"]+B*50<=ModulList[i].Zug[o]["Laenge"]: if ModulList[i].Zug[o]["StartPos"]+B*50>0: #print("Zug auf null") if Spieler.x == -450: Spielstopp = True GameOver=label(pos=(0,0,0), text=' Game Over \n\nPress "Esc" To Exit') print("Crash!") exit() elif ModulList[i].Zug[o]["Stelle"] == "m": #print("Mitte") if ModulList[i].Zug[o]["StartPos"]+B*50<=ModulList[i].Zug[o]["Laenge"]: if ModulList[i].Zug[o]["StartPos"]+B*50>0: #print("Zug auf null") if Spieler.x == 0: Spielstopp = True GameOver=label(pos=(0,0,0), text=' Game Over \n\nPress "Esc" To Exit') print("Crash!") exit() elif ModulList[i].Zug[o]["Stelle"] == "r": #print("Rechts") if ModulList[i].Zug[o]["StartPos"]+B*50<=ModulList[i].Zug[o]["Laenge"]: if ModulList[i].Zug[o]["StartPos"]+B*50>0: #print("Zug auf null") if Spieler.x == 450: Spielstopp = True GameOver=label(pos=(0,0,0), text=' Game Over \n\nPress "Esc" To Exit') print("Crash!") exit() def Method(Spieler): while True: Bewegen(Spieler) #Schleife(Spieler) time.sleep(0.01) def adden(f): global D if f ==1: ModulList.append(Modul1(position = (0,0,0))) D = D+1 elif f == 2: ModulList.append(Modul2(position = (0,0,0))) D = D+1 elif f == 3: ModulList.append(Modul3(position = (0,0,0))) D = D+1 elif f == 4: ModulList.append(Modul4(position = (0,0,0))) D = D+1 elif f == 5: ModulList.append(Modul5(position = (0,0,0))) D = D+1 #ModulList.append(Modul1(position = (0,0,0))) #ModulList.append(Modul2(position = (0,0,0))) #ModulList.append(Modul3(position = (0,0,0))) #ModulList.append(Modul4(position = (0,0,0))) #ModulList.append(Modul5(position = (0,0,0))) """def Schleife(Spieler): i = 5 global A global mytext b = True while True: rate(15) if scene.kb.keys: zeichen = scene.kb.getkey() print (zeichen) if zeichen == "a": if Spieler.pos == (0,120,0): Spieler.pos =(-450,120,0) elif Spieler.pos == (450,120,0): Spieler.pos = (0,120,0) elif zeichen =="d": if Spieler.pos == (-450,120,0): Spieler.pos=(0,120,0) elif Spieler.pos == (0,120,0): Spieler.pos = (450,120,0) rate(150) if b == true: Spieler.arm1.rotate( angle=-0.1, axis=(1,0,0), origin=(0,30,0)) Spieler.arm2.rotate( angle=0.1, axis=(1,0,0), origin=(0,30,0)) Spieler.bein1.rotate( angle=0.1, axis=(1,0,0), origin=(0,-30,0)) Spieler.bein2.rotate( angle=-0.1, axis=(1,0,0), origin=(0,-30,0)) A = A+1 Score.text = str(A) i= i-1 #print(i) print(A) if i < -3: print("Eins") b = false else: Spieler.arm1.rotate( angle=0.1, axis=(1,0,0), origin=(0,30,0)) Spieler.arm2.rotate( angle=-0.1, axis=(1,0,0), origin=(0,30,0)) Spieler.bein1.rotate( angle=-0.1, axis=(1,0,0), origin=(0,-30,0)) Spieler.bein2.rotate( angle=0.1, axis=(1,0,0), origin=(0,-30,0)) i = i+1 A = A+1 Score.text = str(A) #print(i) print(A) if i > 20: print("Zwei") b = true""" Sour = Sourounding (position= (0,0,-12300/2)) Sp = Spieler(position=(0,120,0)) print("Spieler") Method(Sp)