home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2001 May / maximum-cd-2001-05.iso / Blade of Darkness / data1.cab / Program_Executable_Files / Maps / Ragnar_M2 / pendulos.py < prev    next >
Encoding:
Text File  |  2000-11-16  |  2.1 KB  |  98 lines

  1. import def_class
  2. import Bladex
  3. import AuxFuncs
  4. import Sounds
  5.  
  6.  
  7.  
  8. MESSAGE_START_WEAPON         =7
  9. MESSAGE_STOP_WEAPON          =8
  10.  
  11. Bladex.CreateTimer("Timer30",1.0/30.0)
  12.  
  13. MuerteBarb1=Bladex.CreateSound('..\\..\\sounds\\muerte-barb-1.wav', 'MuerteBarbaro1')
  14.  
  15. Bladex.AddParticleGType("Flame","FireParticle",B_PARTICLE_GTYPE_ADD,20)
  16.  
  17. for i in range(20):
  18.     if i>14:
  19.         aux=1.0
  20.         caux=1.0/3.0
  21.         saux=1.0
  22.     else:
  23.         aux=1.0-((14.0-i)/14.0) #va de 1 a 0
  24.         caux=1.0/3.0
  25.         saux=1.0-2*((14.0-i)/14.0) #va de 1 a -1
  26.     
  27.     r=155.0*3.0*caux
  28.     g=155.0*3.0*caux
  29.     b=min(255*(1.0-2.0*caux), 255.0)
  30.     a=150.0*aux
  31.     size=600.0+200.0*saux
  32.     Bladex.SetParticleGVal("Flame",i,r,g,b,a,size)
  33.  
  34.  
  35. Bladex.AddParticleGType("Explode","FireParticle",B_PARTICLE_GTYPE_ADD,20)
  36.  
  37. for i in range(20):
  38.     if i>14:
  39.         aux=1.0
  40.         caux=1.0/3.0
  41.         saux=1.0
  42.     else:
  43.         aux=1.0-((14.0-i)/14.0) #va de 1 a 0
  44.         caux=1.0/3.0
  45.         saux=1.0-2*((14.0-i)/14.0) #va de 1 a -1
  46.     
  47.     r=155.0*3.0*caux
  48.     g=155.0*3.0*caux
  49.     b=min(255*(1.0-2.0*caux), 255.0)
  50.     a=150.0*aux
  51.     size=300.0+300.0*saux
  52.     Bladex.SetParticleGVal("Explode",i,r,g,b,a,size)
  53.  
  54.  
  55.  
  56. Trampa_Pendulos = 0
  57. DesactivarPendulos = 0
  58. ExHitFunc = 0
  59.  
  60.  
  61.  
  62. P1 = CreatePendulo("Pendulo1")
  63. P1.Piv = [0,0,4900]
  64. P1.Axi = [1,0,0]
  65. P1.Angulo = 0
  66. P1.Dir = 1
  67. P1.Vel = 0.03
  68. P1.fAc = -0.003
  69.  
  70. P2 = CreatePendulo("Pendulo2")
  71. P2.Piv = [0,0,4900]
  72. P2.Axi = [1,0,0]
  73. P2.Angulo = 0
  74. P2.Dir = -1
  75. P2.Vel = 0.026
  76. P2.fAc = -0.0045
  77.  
  78. P1.Pendulo.RotateRel(P1.Piv[0],P1.Piv[1],P1.Piv[2],P1.Axi[0],P1.Axi[1],P1.Axi[2],0)
  79. P2.Pendulo.RotateRel(P2.Piv[0],P2.Piv[1],P2.Piv[2],P2.Axi[0],P2.Axi[1],P2.Axi[2],0)
  80.  
  81.  
  82.  
  83. zoc1 = Bladex.GetEntity("zoc1")
  84. zoc2 = Bladex.GetEntity("zoc2")
  85. pen1 = Bladex.GetEntity("Pendulo1")
  86. pen2 = Bladex.GetEntity("Pendulo2")
  87.  
  88. zoc1.ExcludeHitFor(pen1)
  89. zoc1.ExcludeHitFor(pen2)
  90. zoc2.ExcludeHitFor(pen1)
  91. zoc2.ExcludeHitFor(pen2)
  92.  
  93. Pendulo_Sector1 = Bladex.GetSector(-96121.5769213, 6251.5, -87959.059290)
  94. Pendulo_Sector1.OnEnter = Activar_Pendulos
  95. Pendulo_Sector1.OnLeave = Desactivar_Pendulos
  96. Pendulo_Sector2 =  Bladex.GetSector(-102168.828801, 7251.5, -94608.10031)
  97. Pendulo_Sector2.OnEnter = ActivarDesactivadoPendulos
  98.