Impact

» Edit Game Info

1 month 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.

1 month 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;
    }
}

1 month ago by stahlmanDesign

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

Post Reply

Please login or register to reply.