refactor: extreure helpers per reduir complexitat cognitiva (tidy net)

This commit is contained in:
2026-05-16 16:13:57 +02:00
parent b984e6041e
commit e1bc1b597f
31 changed files with 1145 additions and 1332 deletions
+5 -5
View File
@@ -22,25 +22,25 @@ Engendro::Engendro(Jd8::Surface gfx, Uint16 x, Uint16 y)
entitat.animacions[0].frames = {0, 1, 2, 3, 2, 1};
this->cur_frame = 0;
this->vida = 18;
this->vida_ = 18;
this->x = x;
this->y = y;
this->o = 0;
this->cycles_per_frame = 30;
this->cycles_per_frame_ = 30;
}
auto Engendro::update() -> bool {
bool mort = false;
if (Jg::getCycleCounter() % this->cycles_per_frame == 0) {
if (Jg::getCycleCounter() % this->cycles_per_frame_ == 0) {
this->cur_frame++;
if (this->cur_frame == entitat.animacions[this->o].frames.size()) {
this->cur_frame = 0;
}
this->vida--;
this->vida_--;
}
if (vida == 0) {
if (vida_ == 0) {
mort = true;
}