5 return nam==
'car' or nam==
'porsche'
9 evenodd= (2*(self.
num_un %2) - 1)
10 x_coord = -evenodd * 30
11 un = VS.launch (
"traffic",name,
"neutral",
"unit",
"modules/traffic.py",1,1,(x_coord,0,self.
num_un*100),
'')
12 un.SetOrientation ((0,1,0),(0,0,evenodd))
15 Director.Mission.__init__(self)
19 for i
in range(numcar):
21 for i
in range(numspec):
24 un = VS.getUnit (self.
iter)
32 self.EventualExecute()
33 iter = VS.getUnitList ()
35 playa = VS.getPlayer()
38 self.ApplyPerFrameEnvironment (un,playa)
44 posdiff = playa.Position()[2]-un.Position()[2]
45 if ((posdiff*(2*(posdiff>0)-1))>1500):
46 R = un.GetOrientation ()[2]
49 pos=(un.Position()[0],0,playa.Position()[2]+4000*(2*(R[2]<0)-1),)
50 un.SetCurPosition (pos)
54 vel = un.GetVelocity()
57 un.SetCurPosition(pos)
59 vel = (vel[0],0,vel[2])
62 vel = (0,vel[1],vel[2])