feat(enemy): sistema d'HP declaratiu i nou enemic big_pentagon
This commit is contained in:
@@ -13,6 +13,7 @@ EnemyConfig EnemyRegistry::pentagon_config;
|
||||
EnemyConfig EnemyRegistry::square_config;
|
||||
EnemyConfig EnemyRegistry::pinwheel_config;
|
||||
EnemyConfig EnemyRegistry::star_config;
|
||||
EnemyConfig EnemyRegistry::big_pentagon_config;
|
||||
bool EnemyRegistry::loaded = false;
|
||||
|
||||
namespace {
|
||||
@@ -38,10 +39,11 @@ auto EnemyRegistry::loadAll() -> bool {
|
||||
const bool OK = loadOne("pentagon", EnemyType::PENTAGON, pentagon_config) &&
|
||||
loadOne("square", EnemyType::SQUARE, square_config) &&
|
||||
loadOne("pinwheel", EnemyType::PINWHEEL, pinwheel_config) &&
|
||||
loadOne("star", EnemyType::STAR, star_config);
|
||||
loadOne("star", EnemyType::STAR, star_config) &&
|
||||
loadOne("big_pentagon", EnemyType::BIG_PENTAGON, big_pentagon_config);
|
||||
loaded = OK;
|
||||
if (OK) {
|
||||
std::cout << "[EnemyRegistry] 4 configuracions d'enemic carregades.\n";
|
||||
std::cout << "[EnemyRegistry] 5 configuracions d'enemic carregades.\n";
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
@@ -60,6 +62,8 @@ auto EnemyRegistry::get(EnemyType type) -> const EnemyConfig& {
|
||||
return pinwheel_config;
|
||||
case EnemyType::STAR:
|
||||
return star_config;
|
||||
case EnemyType::BIG_PENTAGON:
|
||||
return big_pentagon_config;
|
||||
}
|
||||
std::cerr << "[EnemyRegistry] FATAL: tipus desconegut\n";
|
||||
std::exit(EXIT_FAILURE);
|
||||
|
||||
Reference in New Issue
Block a user