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

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.

10 years ago by RiceofEarth

I should mention, they are able to bounce off each other without a problem

10 years ago by RiceofEarth

Okay I'm beyond confused, I just increased their speed and movement time and now they bounce off walls...
Page 1 of 1
« first « previous next › last »