claude: mogut initBalloonFormations() a un fitxer extern
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user