Hi Mahmood,
Apply this script to the Ball and execute vibrateStage(me) handler whenever
you want to vibrate the stage.
-- Stage vibrate behavior
property pStageRect
property pVibrateAmmount
property pVibrateAmmountTmp
property pVibrateMomentum
property pVibrate
property plOrR
on beginSprite me
pStageRect = (the stage).sourceRect
pVibrate = FALSE
plOrR = -1
end
on exitFrame me
if pVibrate then
if pVibrateAmmountTmp <= 0 then
(the stage).rect = pStageRect
pVibrate = FALSE
exit
end if
plOrR = plOrR * -1
theRect = offset((the stage).sourceRect, pVibrateAmmountTmp * plOrR, 0)
(the stage).rect = theRect
pVibrateAmmountTmp = pVibrateAmmountTmp - pVibrateMomentum/2
end if
end
on vibrateStage me
if pVibrate then exit
pVibrate = TRUE
pVibrateAmmountTmp = pVibrateAmmount
pVibrateMomentum = pVibrateAmmount/2
-- puppetSound 1, "vibrate sound"
end
on getPropertyDescriptionList me
pdList = []
pdList.addprop(#pVibrateAmmount, [#comment "Ammount of vibration", \
#format#integer, default3, #range[#min3,#max10]])
return pdList
end
regards
----------------------------------------------------------
Ramesh CT
Phoenix Global Solutions (I) Pvt Ltd
http://www.lingoman.net/
----------------------------------------------------------
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]