claude: mogut initBalloonFormations() a un fitxer extern

This commit is contained in:
2025-07-20 20:21:14 +02:00
parent f6228ae0c1
commit 228968c728
7 changed files with 620 additions and 321 deletions

View File

@@ -192,15 +192,13 @@ auto Item::getCoffeeMachineSpawn(int player_x, int item_width, int area_width, i
if (can_spawn_right) {
// Solo lado derecho disponible
return rand() % (RIGHT_BOUND - exclude_right) + exclude_right;
} else {
// No hay espacio suficiente lejos del jugador
// Por ahora, intentar spawn en el extremo más lejano posible
int distance_to_left = abs(player_x - LEFT_BOUND);
int distance_to_right = abs(RIGHT_BOUND - player_x);
} // No hay espacio suficiente lejos del jugador
// Por ahora, intentar spawn en el extremo más lejano posible
int distance_to_left = abs(player_x - LEFT_BOUND);
int distance_to_right = abs(RIGHT_BOUND - player_x);
if (distance_to_left > distance_to_right) {
return LEFT_BOUND;
}
return RIGHT_BOUND - item_width;
if (distance_to_left > distance_to_right) {
return LEFT_BOUND;
}
return RIGHT_BOUND - item_width;
}