10 years ago by RiceofEarth
handleMovementTrace : function( res ) { if(this.vel.x != 0) ig.log(this.vel.x); if(res.collision.x) { ig.log("HIT X"); this.vel.x *= -1; } if(this.vel.x != 0) ig.log(this.vel.x); this.parent(res); if(this.vel.x != 0) ig.log(this.vel.x); },
I have this code to try to see why my object is not bouncing. Instead it just decides all it wants to do is slide against the wall.
For some reason 'Hit X' is only hit when I put this.vel.x into the update loop.
I have double checked my code to verify that vel.x is not being modified in the update loop when this happens. I've also set Bounciness to 10 and collides to ig.Entity.COLLIDES.ACTIVE
Where am I going wrong?
EDIT: I'm officially stupid, .minBounceVelocity.