initial commit

This commit is contained in:
2025-05-21 11:29:48 -04:00
commit 614ada45fd
19 changed files with 1093 additions and 0 deletions

26
src/Bubble.cpp Normal file
View File

@@ -0,0 +1,26 @@
#include "Bubble.h"
#include "Aquarium.h"
#include <ncurses.h>
Bubble::Bubble(float x, float y) : Entity() {
this->x = x;
this->y = y;
}
void Bubble::update() { y -= 1; }
void Bubble::draw() {
lifetime++;
// Determine the frame based on lifetime
int frameNumber = lifetime / 9;
if (frameNumber > 2)
frameNumber = 2;
char frame = bubbleChars[frameNumber];
std::string line(1, frame);
std::string colorLine(1, 'c');
Aquarium::getInstance().drawToBackBuffer(y, x, 0, line, colorLine);
}