Mario: change size and texture when Mario eats a mushroom

This commit is contained in:
2022-10-25 19:33:09 +02:00
parent 1462c2211b
commit d89712ebab
3 changed files with 47 additions and 20 deletions
+9 -14
View File
@@ -25,20 +25,8 @@ public:
return _death;
}
void handleDeath();
void setBig() {
if (isBig()) {
setFireFlag();
} else {
setBigFlag();
}
}
void unsetBig() {
if (hasFire()) {
unsetFireFlag();
} else {
unsetBigFlag();
}
}
void setBig();
void unsetBig();
void setStar() {
setStarFlag();
}
@@ -86,6 +74,13 @@ private:
void stopMovement();
uint8_t special_flags = 0;
// SRCs
const SDL_Rect *standing_src = &MARIO_STANDING_SRC;
const SDL_Rect *death_src = &MARIO_DEATH_SRC;
const SDL_Rect *change_dir_src = &MARIO_CHANGE_DIR_SRC;
const SDL_Rect *jump_src = &MARIO_JUMP_SRC;
const std::vector<SDL_Rect> *walk_anim = &MARIO_WALK_ANIM;
void setBigFlag() {
special_flags = special_flags | BIG_FLAG;
}