PDA

Click to See Complete Forum and Search --> : scripting 'real' movement



woodoodledoo
08-06-2002, 06:51 AM
Hey guys,

I'm working on a scrolling menu system based on actionscript. I really want to add real movement to it, i.e. acceleration and deceleration. I've had a bash but to no avail.

I have both my start and finish values for the x axis of the menu. All i need to know now is the correct method to generate the realistic movement. Any hints would be much appreciated.

Matt

UnderTheSun
08-06-2002, 09:10 PM
well
here's a script you might want

menu._y = menu._y + ((target._y - menu._y)/3)
you gotta repeat this tho :)

that's deceleration :)

acceleration is a bit more complex, but you can just distort the tween timeline by making new keyframes and moving them "later" in the timeline. cheap? well that's my first acceleration and deceleration techniques :D

no actionscript needed on the second method.

did this help?

pheck
08-07-2002, 01:14 AM
accel can be done the same way. you just multiply instead of divide. and you have to throw in a check for when to stop accelerating (i.e.-



if(this._x >= 25)
stop();
else
gotoAndPlay(1);


where frame 1 has your accel script

just one of many ways...