refactor bubble

This commit is contained in:
2025-05-22 21:47:25 -04:00
committed by laugos
parent d29689e1b2
commit 96b995bbd9
4 changed files with 26 additions and 27 deletions

View File

@@ -91,7 +91,7 @@ void Aquarium::redraw() {
auto &bubble = *it;
bubble->draw();
bubble->update();
if (bubble->getY() < 9)
if (bubble->isOutOfWater())
it = bubbles.erase(it);
else
++it;
@@ -137,7 +137,7 @@ void Aquarium::redraw() {
applyBackBuffer();
}
void Aquarium::addBubble(float x, float y) {
void Aquarium::addBubble(size_t x, size_t y) {
bubbles.emplace_back(std::make_unique<Bubble>(x, y));
}