Simplify BaseGame interactions

This commit is contained in:
Lukas Klingsbo
2020-11-14 14:34:39 +01:00
parent 64068ebad9
commit 0135f93493
4 changed files with 27 additions and 28 deletions

View File

@ -73,12 +73,12 @@ class MyGame extends BaseGame with DoubleTapDetector, TapDetector {
components.forEach((c) {
if (c is PositionComponent && c.toRect().overlaps(touchArea)) {
handled = true;
markToRemove(c);
remove(c);
}
});
if (!handled) {
addLater(Square()
add(Square()
..x = touchArea.left
..y = touchArea.top);
}