home *** CD-ROM | disk | FTP | other *** search
/ Inventor Labs: Technology / INVENTORLABS_TECHNOLOGY.BIN / pc / files / invest.dir / 00521_Script_AeronauticParentScript < prev    next >
Text File  |  1997-05-26  |  3KB  |  118 lines

  1. --o Aeronautics Object Parent Script
  2.  
  3.  
  4. property pLiftFactor
  5. property pAngle
  6. property pZeroAngle
  7. property pSpeed
  8. property pWeight
  9. property pWing
  10. property pPosition
  11.  
  12. property pPointerSprite
  13. property pWingSprite
  14. property pMaximumWingPosition
  15. property pMinimumWingV
  16.  
  17. property pFirstWing
  18.  
  19. ------------------------------
  20. on mInit me
  21.   
  22.   set pWingSprite = 4
  23.   set pPointerSprite = 5
  24.   
  25.   set pLiftFactor =[.02, .05, .03, .06,.08, .1]
  26.   set pZeroAngle = [0, 0, 0, 0, -2, -2]
  27.   
  28.   set pMaximumWingPosition = 100 -- 120
  29.   set pMinimumWingV = 178 -- 186
  30.   
  31.   set pFirstWing = the number of cast "box00000.8bt"
  32.   
  33.   return me
  34.   
  35. end 
  36. ------------------------------
  37. on mActivate me
  38.   set pSpeed = 3
  39.   set pAngle = 5
  40.   set pWeight = 6
  41.   set pWing = 2
  42.   set pPosition = 0
  43.   
  44.   set the puppet of sprite pWingSprite = 1
  45.   set the puppet of sprite pPointerSprite = 1
  46.   
  47.   mUpdateWingPosition me
  48.   
  49. end
  50. ------------------------------
  51. on mClose me
  52.   set the puppet of sprite pWingSprite = 0
  53.   set the puppet of sprite pPointerSprite = 0
  54.   
  55.   --tj&dl
  56.   repeat with n = 2 to 20
  57.     set the puppet of sprite n = 0
  58.     set the visible of sprite n = 1
  59.   end repeat
  60.     puppetsprite 33,  false
  61. end 
  62.  
  63. ------------------------------
  64. on mResetWingValue me, WingPosition
  65.   set pWing = WingPosition
  66.   mUpdateWing me
  67. end
  68.  
  69. ------------------------------
  70. on mResetSpeedValue me, SpeedValue
  71.   set pSpeed = SpeedValue
  72. end
  73.  
  74. ------------------------------
  75. --DL
  76. on mRaiseAngle me
  77.   if pAngle < 9 then
  78.     set pAngle = pAngle +1
  79.     set the castnum of sprite pPointerSprite to the castnum of sprite pPointerSprite + 1 -- 5
  80.     set the castnum of sprite pWingSprite to the castnum of sprite pWingSprite + 1
  81.   end if
  82. end mRaiseAngle
  83.  
  84. ------------------------------
  85. --DL
  86. on mDropAngle me
  87.   if pAngle > 1 then
  88.     set the castnum of sprite pPointerSprite to the castnum of sprite pPointerSprite - 1
  89.     set the castnum of sprite pWingSprite to the castnum of sprite pWingSprite - 1
  90.     set pAngle = pAngle -1
  91.   end if
  92. end mDropAngle
  93.  
  94. ------------------------------
  95. --DL
  96. on mUpdateWingPosition me
  97.   set pWingpAngle = (pAngle-5)*3.
  98.   set liftCoeff = (pWingpAngle - getAt(pZeroAngle, pWing))*getAt(pLiftFactor, pWing)
  99.   set lift = pSpeed*pSpeed*liftCoeff
  100.   set NetLift = lift - pWeight
  101.   set pPosition = pPosition + Netlift/10.0
  102.   
  103.   if pPosition < 0 then set pPosition = 0
  104.   else if pPosition > pMaximumWingPosition then set pPosition = pMaximumWingPosition
  105.   
  106.   set the locV of sprite pWingSprite = pMinimumWingV - pPosition
  107.   
  108. end mUpdateWingPosition
  109.  
  110. ---------------------------------------
  111.  
  112. on mUpdateWing me
  113.   set temp = (pWing-1)*9+pFirstWing+pAngle-1
  114.   set the castnum of sprite pWingSprite to temp
  115. end mUpdateWing
  116.  
  117.  
  118.