getCollisionVelocityReflection method

  1. @override
Vector2 getCollisionVelocityReflection(
  1. PositionComponent other,
  2. CollisionData data
)
override

Implementation

@override
Vector2 getCollisionVelocityReflection(
  PositionComponent other,
  CollisionData data,
) {
  if (_bouncingObjectEnabled && onBouncingCollision(other)) {
    return super.getCollisionVelocityReflection(other, data) *
        _bouncingReflectFactor;
  }
  return super.getCollisionVelocityReflection(other, data);
}