onCollision method
if return false
so the object will not collide with anything or block the passage.
Implementation
@override
bool onCollision(GameComponent component, bool active) {
if (component is Attackable && !component.shouldRemove) {
component.receiveDamage(attackFrom, damage, id);
} else if (!withDecorationCollision) {
return false;
}
_destroyObject();
return true;
}