1
This commit is contained in:
@@ -35,6 +35,23 @@ namespace {
|
||||
file << "Igralec: " << playerName << "\n";
|
||||
file << "Točke: " << score << "\n";
|
||||
file << "Datum: " << std::put_time(&localTime, "%Y-%m-%d %H:%M:%S") << "\n";
|
||||
|
||||
// Replay system
|
||||
std::vector<Game::Object::Transform> playerHistory;
|
||||
Game::GameManager::getPlayerPositionHistory(playerHistory);
|
||||
std::ofstream replayFile("replay.txt", std::ios::trunc);
|
||||
if (!replayFile.is_open()) {
|
||||
WARN("Neuspešno odpiranje replay.txt za pisanje");
|
||||
return;
|
||||
}
|
||||
|
||||
for (const auto& transform : playerHistory) {
|
||||
replayFile << transform.x << " " << transform.y << " " << transform.rotation << " " << transform.scaleX << " " << transform.scaleY << "\n";
|
||||
}
|
||||
|
||||
LOG("Zapis končne statistike in replaya igre dokončan");
|
||||
replayFile.close();
|
||||
file.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -161,6 +161,9 @@ namespace Game::AGame {
|
||||
} else if (!mIsShipMode && mGroundTex) {
|
||||
setTexture(mGroundTex);
|
||||
}
|
||||
|
||||
// Push replay
|
||||
GameManager::pushPlayerPosition(mTransform);
|
||||
}
|
||||
|
||||
void Player::onCollisionEnter(Object::Entity* other) {
|
||||
|
||||
Reference in New Issue
Block a user