Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

7 months ago by ansimuz

Hi,

Simple question. I want an entity to bounce eternally at the same velocity. What would be the best way to do this.

7 months ago by ansimuz

Found the solution.

I override the handle movement function so whenever it hits the ground a constant velocity to y is applied:

handleMovementTrace: function (res) {   
    this.parent(res);
    if (res.collision.y  ) {
        this.vel.y = -this.speed;
    }
}

7 months ago by stahlmanDesign

Nice solution
Page 1 of 1
« first « previous next › last »