feat(enemy): afegir tipus STAR (estrella de 5 puntes) i 3 nous shapes

- Nou enemic STAR amb shape star_5.shp, escala 0.7 i color groc pur.
  Reusa el comportament zigzag del Pentagon i carrega via EnemyRegistry.
- DistribucioEnemics estesa amb camp 'star' opcional (default 0) per
  mantenir compat amb stages antics.
- Stage 1 reconfigurat a 25/25/25/25 per mostrar els 4 tipus.
- Afegits també shapes bullet_long.shp i bullet_double.shp (encara no
  utilitzats; preparats per futures variants de bala).
This commit is contained in:
2026-05-25 12:36:26 +02:00
parent b3a1afce06
commit bc41169176
13 changed files with 343 additions and 211 deletions
+6 -2
View File
@@ -12,6 +12,7 @@
EnemyConfig EnemyRegistry::pentagon_config;
EnemyConfig EnemyRegistry::square_config;
EnemyConfig EnemyRegistry::pinwheel_config;
EnemyConfig EnemyRegistry::star_config;
bool EnemyRegistry::loaded = false;
namespace {
@@ -36,10 +37,11 @@ namespace {
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("pinwheel", EnemyType::PINWHEEL, pinwheel_config) &&
loadOne("star", EnemyType::STAR, star_config);
loaded = OK;
if (OK) {
std::cout << "[EnemyRegistry] 3 configuracions d'enemic carregades.\n";
std::cout << "[EnemyRegistry] 4 configuracions d'enemic carregades.\n";
}
return OK;
}
@@ -56,6 +58,8 @@ auto EnemyRegistry::get(EnemyType type) -> const EnemyConfig& {
return square_config;
case EnemyType::PINWHEEL:
return pinwheel_config;
case EnemyType::STAR:
return star_config;
}
std::cerr << "[EnemyRegistry] FATAL: tipus desconegut\n";
std::exit(EXIT_FAILURE);