Hello everyone!
Iām in the process of creating an earthquake that takes place in an office setting. This will require the entire room to rumble. I found the following script that makes things rumble fairly well when I slap it on a movie clip:
onClipEvent (load) {
//movie width/height
height = 200;
width = 300;
//------------------------//
//makes everything random //
//------------------------//
//setting initial position
cx = this._x;
cy = this._y;
}
onClipEvent (enterFrame) {
//causes the object to be offset
this._x = cx+(1+Math.random()*5); //The "5" controls the amount of rumble
this._y = cy+(Math.random()*5); //The "5" controls the amount of rumble
}
However, I need a way to gracefully fade the rumbling in, and eventually fade it out when the earthquake stops. Does anyone know the best way to accomplish such a thing? It could either be some kind of hardcoded number that corresponds with the length of the earthquake, or even something that is timeline based. If anyone has done anything like this, please help!
Thank you,
-Eric