Fix hitbox circle on flip (#1165)

This commit is contained in:
Lukas Klingsbo
2021-12-05 20:38:52 +01:00
committed by GitHub
parent bfcda073bb
commit c35fb46078
3 changed files with 5 additions and 4 deletions

View File

@ -39,13 +39,12 @@ class MyCollidable extends PositionComponent
position: position,
size: Vector2.all(100),
anchor: Anchor.center,
) {
addHitbox(HitboxCircle());
}
);
@override
Future<void> onLoad() async {
await super.onLoad();
addHitbox(HitboxCircle());
final center = gameRef.size / 2;
velocity = (center - position)..scaleTo(150);
}