Jump to content
Search Community

Ikuro1o

Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by Ikuro1o

  1. Hello, I'm a new user in the world of GSAP. For one reason, I'd like to know for the gsap.to() equals in pure css/ javascript. I's rather to learn the basic properties that gsap.to() uses to animate it. This is an example from Chris Course in Youtube:

     

    class Enemy {
        constructor(x,y,rad,color,velocity){
            this.x = x;
            this.y = y;
            this.rad =rad;
            this.color = color;
            this.velocity = velocity;
        }
    
        create() {
            c.beginPath();
            c.arc(this.x, this.y, this.rad, 0, Math.PI *2, false);
            c.fillStyle = this.color;
            c.fill();
        }
    
        update() {
            this.create();
            this.x += this.velocity.x;
            this.y += this.velocity.y;
        }
    }
    
    //When a bullet reach a big enemy 
    gsap.to(Enemy, { rad: Enemy.rad -11 });
    //...

    Is there any pure css or javascript equal for the gsap.to() in the example? Thank you in advance

×
×
  • Create New...