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

1 decade ago by SlinkyDinky

This is my entity:

	EntityEnemy = ig.Entity.extend({
		animSheet: new ig.AnimationSheet('media/sprites.png', 10, 10),
		size: {x: 10, y: 10},
		bounciness: 1,

		type: ig.Entity.TYPE.B,
		collides: ig.Entity.COLLIDES.ACTIVE,

		init: function(x, y, settings){
			this.parent(x, y, settings);
			this.addAnim('idle', 1, [2]);
		},

Very rarely it seems to bounce back from hitting the collision layer. Most of the time it simply stops, and continues along the axis of the collision layer if it's velocity allows it.

Any ideas why?

1 decade ago by mdkess

I suspect that in your update function, you are setting the velocity of the entity, counteracting the effects of the bounciness.

1 decade ago by Joncom

In the off chance you find it helpful:
Demo of bounciness in action.
Example code of the above demo.

Edit:

Also, see .minBounceVelocity.
It could be the reason entities are not bouncing.
Page 1 of 1
« first « previous next › last »