home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Inventor Labs: Technology
/
INVENTORLABS_TECHNOLOGY.BIN
/
pc
/
files
/
invest.dir
/
00521_Script_AeronauticParentScript
< prev
next >
Wrap
Text File
|
1997-05-26
|
3KB
|
118 lines
--o Aeronautics Object Parent Script
property pLiftFactor
property pAngle
property pZeroAngle
property pSpeed
property pWeight
property pWing
property pPosition
property pPointerSprite
property pWingSprite
property pMaximumWingPosition
property pMinimumWingV
property pFirstWing
------------------------------
on mInit me
set pWingSprite = 4
set pPointerSprite = 5
set pLiftFactor =[.02, .05, .03, .06,.08, .1]
set pZeroAngle = [0, 0, 0, 0, -2, -2]
set pMaximumWingPosition = 100 -- 120
set pMinimumWingV = 178 -- 186
set pFirstWing = the number of cast "box00000.8bt"
return me
end
------------------------------
on mActivate me
set pSpeed = 3
set pAngle = 5
set pWeight = 6
set pWing = 2
set pPosition = 0
set the puppet of sprite pWingSprite = 1
set the puppet of sprite pPointerSprite = 1
mUpdateWingPosition me
end
------------------------------
on mClose me
set the puppet of sprite pWingSprite = 0
set the puppet of sprite pPointerSprite = 0
--tj&dl
repeat with n = 2 to 20
set the puppet of sprite n = 0
set the visible of sprite n = 1
end repeat
puppetsprite 33, false
end
------------------------------
on mResetWingValue me, WingPosition
set pWing = WingPosition
mUpdateWing me
end
------------------------------
on mResetSpeedValue me, SpeedValue
set pSpeed = SpeedValue
end
------------------------------
--DL
on mRaiseAngle me
if pAngle < 9 then
set pAngle = pAngle +1
set the castnum of sprite pPointerSprite to the castnum of sprite pPointerSprite + 1 -- 5
set the castnum of sprite pWingSprite to the castnum of sprite pWingSprite + 1
end if
end mRaiseAngle
------------------------------
--DL
on mDropAngle me
if pAngle > 1 then
set the castnum of sprite pPointerSprite to the castnum of sprite pPointerSprite - 1
set the castnum of sprite pWingSprite to the castnum of sprite pWingSprite - 1
set pAngle = pAngle -1
end if
end mDropAngle
------------------------------
--DL
on mUpdateWingPosition me
set pWingpAngle = (pAngle-5)*3.
set liftCoeff = (pWingpAngle - getAt(pZeroAngle, pWing))*getAt(pLiftFactor, pWing)
set lift = pSpeed*pSpeed*liftCoeff
set NetLift = lift - pWeight
set pPosition = pPosition + Netlift/10.0
if pPosition < 0 then set pPosition = 0
else if pPosition > pMaximumWingPosition then set pPosition = pMaximumWingPosition
set the locV of sprite pWingSprite = pMinimumWingV - pPosition
end mUpdateWingPosition
---------------------------------------
on mUpdateWing me
set temp = (pWing-1)*9+pFirstWing+pAngle-1
set the castnum of sprite pWingSprite to temp
end mUpdateWing