fix game over

This commit is contained in:
Vlad committed 2026-02-28 12:07:40 +06:00
1 parent 7418bbbe27
commit c20e82634a
10 files changed
+94 -31

No files matched your search

+9 -4
View File
@@ -276,7 +276,7 @@ namespace ZL
std::cerr << "Client: Failed to send RESPAWN\n";
}
}
this->playerScore = 0;
std::cerr << "Game restarted\n";
};
@@ -1606,7 +1606,7 @@ namespace ZL
std::cerr << "GAME OVER: collision with planet (moved back and exploded)\n";
menuManager.showGameOver();
menuManager.showGameOver(this->playerScore);
}
else {
bool stoneCollided = false;
@@ -1681,7 +1681,7 @@ namespace ZL
planetObject.planetStones.statuses[collidedTriIdx] = ChunkStatus::Empty;
}
menuManager.showGameOver();
menuManager.showGameOver(this->playerScore);
}
}
}
@@ -1785,12 +1785,17 @@ namespace ZL
shipAlive = false;
gameOver = true;
Environment::shipState.velocity = 0.0f;
menuManager.showGameOver();
menuManager.showGameOver(this->playerScore);
}
else {
deadRemotePlayers.insert(d.targetId);
std::cout << "Marked remote player " << d.targetId << " as dead" << std::endl;
}
if (d.killerId == localId) {
this->playerScore += 1;
std::cout << "Client: Increased local score to " << this->playerScore << std::endl;
}
}
}