SpielfeldV2
field.py — Python Source, 8 KB (8756 bytes)
Dateiinhalt
#author: Mario G. #date: 25.03.2013 #version: 1.0 #name: final from visual import * #scene.stereo="redcyan" class standartfield(frame): def __init__(self, col=color.white, position=(0,0,0), visible=true): frame.__init__(self) self.field=box(frame=self, pos= position, length=2, width=2, height=0.03, color=col) #mention=label(pos=(0,0,0),text='Start') class startfield(frame): def __init__(self, col=color.yellow, positionStart=(0,0,0), visible=true): frame.__init__(self) self.startground=box(frame=self, pos= positionStart, length=8, width=8, height=1, color=col, material=materials.emissive) #mention=label(pos=(0,0,0),text='Start') self.player1= standartfield(position=(-2,1,-2), col= color.orange) self.player2= standartfield(position=(-2,1,2), col= color.orange) self.player3= standartfield(position=(2,1,-2), col= color.orange) self.player4= standartfield(position=(2,1,2), col= color.orange) class groupedfield (frame): def __init__(self, farbeGround= color.magenta, farbeSpezial=color.red, farbePyramide=color.green, groupedfieldPosition=(0,0,0)): frame.__init__(self) #self.ground= box(pos=(0,0,10), length= 80, width= 80, height= 0.1, color= farbeGround, frame= self) self.feld1= standartfield(position=(8,1,0),col=farbeGround) self.feld2= standartfield(position=(13,2, 0),col=farbeGround) self.feld3= standartfield(position=(18,3, 0),col=farbeGround) self.feld4= standartfield(position=(23,4,0),col=farbeGround) self.feld5= standartfield(position=(23,3,5),col=farbeGround) self.feld6= standartfield(position=(23,2,10),col=farbeGround) self.feld7= standartfield(position=(23,1,15),col=farbeGround) self.feld8= standartfield(position=(23,2,20),col=farbeGround) self.feld9= standartfield(position=(23,3,25),col=farbeGround) self.feld10= standartfield(position=(23,4,30),col=farbeGround) self.feld11= standartfield(position=(18,3,30),col=farbeGround) self.feld12= standartfield(position=(13,2,30),col=farbeGround) self.feld13= standartfield(position=(8,1,30),col=farbeGround) self.feld14= standartfield(position=(3,2,30),col=farbeGround) self.feld15= standartfield(position=(-2,3,30),col=farbeGround) self.feld16= standartfield(position=(-7,4,30),col=farbeGround) self.feld17= standartfield(position=(-7,3,25),col=farbeGround) self.feld18= standartfield(position=(-7,2,20),col=farbeGround) self.feld19= standartfield(position=(-7,1,15),col=farbeGround) self.feld20= standartfield(position=(-7,2,10),col=farbeGround) self.feld21= standartfield(position=(-7,3,5),col=farbeGround) self.feld22= standartfield(position=(-7,4,0),col=farbeGround) self.feld23= standartfield(position=(-2,3,0),col=farbeGround) self.feld24= standartfield(position=(3,2,0),col=farbeGround) # self.feldA= standartfield(position=(8,1,-5),col=farbeGround) self.feldB= standartfield(position=(28,1,15),col=farbeGround) self.feldC= standartfield(position=(8,1,35),col=farbeGround) self.feldD= standartfield(position=(-12,1,15),col=farbeGround) self.feldAA= standartfield(position=(8,1,-10),col=farbeGround) self.feldBB= standartfield(position=(33,1,15),col=farbeGround) self.feldCC= standartfield(position=(8,1,40),col=farbeGround) self.feldDD= standartfield(position=(-17,1,15),col=farbeGround) # self.feldAv= standartfield(position=(8,2,5),col=farbeSpezial, visible=False) self.feldAAv= standartfield(position=(8,3,10),col=farbeSpezial, visible=False) self.feldBv= standartfield(position=(18,2,15),col=farbeSpezial, visible=False) self.feldBBv= standartfield(position=(13,3,15),col=farbeSpezial, visible=False) self.feldCv= standartfield(position=(8,2,25),col=farbeSpezial, visible=False) self.feldCCv= standartfield(position=(8,3,20),col=farbeSpezial, visible=False) self.feldDv= standartfield(position=(-2,2,15),col=farbeSpezial, visible=False) self.feldDDv= standartfield(position=(3,3,15),col=farbeSpezial, visible=False) self.feldE= standartfield(position=(8,4,15), col=farbeSpezial, visible=False) # self.deko1= pyramid(pos=(8,4,15), size=(5,5,5), axis=(0,-1,0), color=farbePyramide, visible= True, material=materials.chrome) self.deko2= pyramid(pos=(8,4,15), size=(5,5,5), axis=(0,1,0), color=farbePyramide, visible= True, material=materials.chrome) def special(self, sichtbar): if sichtbar==True: self.feldAv.visible=True self.feldAAv.visible=True self.feldBv.visible= True self.feldBBv.visible=True self.feldCv.visible= True self.feldCCv.visible= True self.feldDv.visible= True self.feldDDv.visible= True self.feldE.visible= True self.deko2.visible= False else: self.feldAv.visible=False self.feldAAv.visible=False self.feldBv.visible= False self.feldBBv.visible=False self.feldCv.visible= False self.feldCCv.visible= False self.feldDv.visible= False self.feldDDv.visible= False self.feldE.visible= False self.deko2.visible= True ereignis=False class felsen(frame): def __init__(self, positionFels=(0,0,0)): frame.__init__(self) steina=box(pos=(5,6,0), length=2, height=3.5, width=3, frame=self) steinb=box(pos=(5-2,5,-1), length=2, height=3, width=2, frame=self) steinc=box(pos=(5-2,5,1), length=3, height=6, width=2.5, frame=self) steind=box(pos=(5-4,5,0), length=3.5, heigth=8, width=2, frame=self) self.pos=positionFels ############################## #nutze groupedfield, variiere Koordinaten start=startfield() # erstePlatte=standartfield(position=(-0,1,6), col=color.orange) platte1=standartfield(position=(0,2,11)) platte2=standartfield(position=(0,3,17)) platte3=standartfield(position=(0,4,22)) platte4=standartfield(position=(0,5,27)) platte5=standartfield(position=(0,6,32)) platte6=standartfield(position=(0,7,37)) platte7=standartfield(position=(5,6,37)) platte8=standartfield(position=(10,5,37)) platte9=standartfield(position=(15,4,37)) platte10=standartfield(position=(20,3,37)) platte11=standartfield(position=(25,2,37)) platte12=standartfield(position=(30,1,37)) platte13=standartfield(position=(35,0,37)) platte14=standartfield(position=(40,-1,37)) platte15=standartfield(position=(45,-2,37)) platte16=standartfield(position=(50,-3,37), col=color.red) platte17=standartfield(position=(55,-4,37), col=color.red) platte18=standartfield(position=(60,-5,37), col=color.red) platte19=standartfield(position=(65,-6,37), col=color.red) platte20=standartfield(position=(70,-7,37), col=color.red) platte21=standartfield(position=(75,-8,37), col=color.red) platte22=standartfield(position=(80,-9,37), col=color.red) platte23=standartfield(position=(85,-10,37), col=color.red) platte24=standartfield(position=(90,-11,37), col=color.red) # platte25=standartfield(position=(45,-2,42)) platte26=standartfield(position=(45,-2,47)) platte27=standartfield(position=(45,-2,52)) platte28=standartfield(position=(45,-2,57)) platte29=standartfield(position=(45,-2,62)) platte29=standartfield(position=(45,-2,67)) platte30=standartfield(position=(50,-3,67)) platte31=standartfield(position=(55,-4,67)) platte32=standartfield(position=(60,-5,67)) platte33=standartfield(position=(65,-6,67)) platte34=standartfield(position=(70,-7,67)) platte35=standartfield(position=(75,-8,67)) platte36=standartfield(position=(80,-9,67)) platte37=standartfield(position=(85,-10,67)) platte38a=standartfield(position=(90,-11,67)) platte38=standartfield(position=(90,-10,62)) platte39=standartfield(position=(90,-9,57)) platte40=standartfield(position=(90,-8,52)) platte41=standartfield(position=(90,-9,47)) platte42=standartfield(position=(90,-10,42)) platte43=standartfield(position=(90,-11,37)) platte44=standartfield(position=(90,-10,32)) platte45=standartfield(position=(90,-9,27)) platte46=standartfield(position=(90,-8,22)) platte47=standartfield(position=(90,-7,17)) platte48=standartfield(position=(90,-6,12)) platte49=standartfield(position=(90,-5,7)) platte50=standartfield(position=(90,-4,2)) platte51=standartfield(position=(90,-3,-2)) platte52=standartfield(position=(90,-2,-7)) platte53=standartfield(position=(90,-1,-12)) # #hindernis1=felsen(positionFels=(90,0,-15)) # #feldgruppe1= groupedfield() #feldgruppe1.special(ereignis)