Jump to content
Search Community

poulaing

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by poulaing

  1. Actually, I need to calculate the bounce manually. I do not want to create a physics engine, just that bouncing thing. Here's a picture to illustrate that:

     

    tweens.png

     

    So I launch Tween1 because I know the direction and the power of the ball. Then, when the ball hits a wall, I need to create a new tween with new parameters. In that case, I would mainly want to change the y progress to set Tween 2.

     

    Is that doable by getting Tween1 values when the ball hits the wall?

     

    Thanks for the help!

  2. Hello, 

     

    I was using x and y properties to make a ball move on a straight line. When hitting a wall (eg. x + xSpeed < 0), I just inverted the xSpeed and the ySpeed values.

     

    Now, I want to switch to GSAP so I can get onComplete callbacks. I can easily detect when the ball goes out of the bounds, but how can I set a new tween to send the ball on the right direction, with the right x, y, duration and tween ease?

     

    Thanks a lot for your help!

×
×
  • Create New...