PDA

View Full Version : Quaking motion



hammml8
February 5th, 2004, 08:46 AM
Is there a way to make an object or text quake using actionscript? I'm looking for a sort of earthquake feel to the movement.

Thanks a bunch!

waztone
February 5th, 2004, 08:55 AM
Try a simple random movement. Just make sure the movement occurs x times/sec and move the object just slightly.

I think.

If I have time I'll work something out.

oldgreymare
February 5th, 2004, 02:02 PM
Here's a tutorial that makes things vibrate that may be what you're looking for.
vibrate tutorial (http://www.kirupa.com/developer/mx/vibrate.htm)

hammml8
February 6th, 2004, 04:42 PM
Oh man, that's almost perfect! But is there a way to slow down the vibration speed a little?

flash4food
February 6th, 2004, 05:13 PM
yes there is, the two easiest ways to do it in my opinion are:
set a lower framerate or
create a variable inside the script to slow it down like this(its the script from the kirupa tutorial)

onClipEvent (enterFrame) {
waiting++
if(waiting>10){
this._x = cx+(1+Math.random()*5);
this._y = cy+(1+Math.random()*5);
waiting=0
}
}