fix(join): registrar el cos físic del jugador al món quan s'uneix
This commit is contained in:
@@ -919,7 +919,10 @@ void GameScene::joinPlayer(uint8_t player_id) {
|
||||
Vec2 spawn_pos = getSpawnPoint(player_id);
|
||||
ships_[player_id].init(&spawn_pos, true);
|
||||
|
||||
// No visual message, just spawn (per user requirement)
|
||||
// Registrar el cos físic al món. Si el jugador començà inactiu, el
|
||||
// constructor no l'havia afegit; sense això, applyForce s'acumula
|
||||
// però mai s'integra → la nau no es desplaça.
|
||||
physics_world_.addBody(&ships_[player_id].getBody());
|
||||
|
||||
std::cout << "[GameScene] Jugador " << (int)(player_id + 1) << " s'ha unit a la match!" << '\n';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user