5 Replies Latest reply on May 28, 2008 8:54 AM by voguecreative

    Friction

    voguecreative
      Hi. I'm trying to implement friction into my code to slow down two balls. Here is my code:

      whiteball.vx = 0; /v=velocity in x axis
      whiteball.vy = 10; /v=velocity in y axis
      whiteball.m = 1; /m=mass

      blackball.vx = 0;
      blackball.vy = 0;
      blackball.m = 1;


      _root.onEnterFrame = function (){

      whiteball._x += whiteball.vx;
      whiteball._y += whiteball.vy;

      blackball._x += blackball.vx;
      blackball._y += blackball.vy;

      I know friction can be used by multiplying by a number less than 0 but im not sure how to impliment it here!

      Thanks