A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: actionscript acceleration

  1. #1
    Senior Member
    Join Date
    May 2001
    Posts
    351

    actionscript acceleration

    so i can script de-celeration, but what about acceleration?
    how do you , onEnterFrame, make something accelerate without going past the target?

    thank you

  2. #2
    Junior Member
    Join Date
    May 2007
    Posts
    2
    Hello there i have a deal for you, if you can tell me how you do you decelleration how ill tell you how to accelerate

  3. #3
    When in doubt ask Eager Beaver's Avatar
    Join Date
    Feb 2007
    Location
    Planet Earth
    Posts
    911
    Please try this code:
    Code:
    var ac=1.1;
    var vx=5;
    mc.onEnterFrame=function(){
    mc._x+=vx;
    vx=vx*ac; //acceleration.
    if(vx>25)ac=0.9; //deceleration.
    if(vx<0.5)vx=0;  
    }
    <signature removed by admin>

  4. #4
    Senior Member
    Join Date
    May 2001
    Posts
    351
    dudes...i posted that 4 years ago
    sorry i didnt come back and close the thread
    but i got it worked out

    thanks anyway

  5. #5
    When in doubt ask Eager Beaver's Avatar
    Join Date
    Feb 2007
    Location
    Planet Earth
    Posts
    911
    Quote Originally Posted by bbchamp88
    Hello there i have a deal for you, if you can tell me how you do you decelleration how ill tell you how to accelerate
    LOL.
    How did bbchamp88 found your thread in the first place!!!
    <signature removed by admin>

  6. #6
    Remotely Driven Googooboyy's Avatar
    Join Date
    Nov 2001
    Location
    Nowhere near you.
    Posts
    284
    This is nostalgic!

  7. #7
    Junior Member
    Join Date
    May 2007
    Posts
    2

    Omfg

    Quote Originally Posted by Eager Beaver View Post
    LOL.
    How did bbchamp88 found your thread in the first place!!!
    Hey man lol i cant belive this has just happend. I havnt been doing actionscript for years right and i posted on this back in 2007.

    I now am trying to rember how to do acceleration and deceleration haha.

    i was just going through the forum and i found my old post by a fluke!

    holly ****. sorry i didnt repsond i would have helped if i remebered lol but yeah i havnt been on here in like 2 years its ****in crazy.

    msn me bbchamp88@gmail.com

    peace

  8. #8
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    Posts
    927
    cool. can't wait myself looking through forums how to multiply matrices or some stuff like that. btw... that just gave me an idea for new thread.
    who is this? a word of friendly advice: FFS stop using AS2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center