nou: bales de colors diferents per a cada jugador

This commit is contained in:
2025-09-26 20:37:00 +02:00
parent 0459b39366
commit 83871273ec
9 changed files with 118 additions and 39 deletions

View File

@@ -33,10 +33,27 @@ auto Bullet::calculateVelocity(Type type) -> float {
}
}
// Construye el string de animación basado en el tipo de bala y si está potenciada
// Construye el string de animación basado en el tipo de bala y color específico
auto Bullet::buildAnimationString(Type type, Color color) -> std::string {
std::string animation_string = color == Color::GREEN ? "powered_" : "normal_";
std::string animation_string;
// Mapear color a string específico
switch (color) {
case Color::YELLOW:
animation_string = "yellow_";
break;
case Color::GREEN:
animation_string = "green_";
break;
case Color::RED:
animation_string = "red_";
break;
case Color::PURPLE:
animation_string = "purple_";
break;
}
// Añadir dirección
switch (type) {
case Type::UP:
animation_string += "up";