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.isRemoving) {
if (component.checkCanReceiveDamage(attackFrom)) {
return true;
} else {
return false;
}
} else if (!withDecorationCollision) {
return false;
}
return true;
}