diff options
| author | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2021-10-20 23:19:17 +0700 |
|---|---|---|
| committer | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2021-10-20 23:19:17 +0700 |
| commit | bd321d051ca8c827a5c8a490afc33812e76abba7 (patch) | |
| tree | de88e5b28345672d952c5cf988dd05b4339aaa74 /src/GameTick.cpp | |
| parent | 446f5c5fd7cd977f096cd2d6256d829a765467c9 (diff) | |
| download | blackshades-bd321d051ca8c827a5c8a490afc33812e76abba7.tar.gz | |
Move scores tracking to user data
Diffstat (limited to 'src/GameTick.cpp')
| -rw-r--r-- | src/GameTick.cpp | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/src/GameTick.cpp b/src/GameTick.cpp index fd9dad5..42af2a6 100644 --- a/src/GameTick.cpp +++ b/src/GameTick.cpp @@ -25,7 +25,6 @@ #include <algorithm> #include <fstream> -#include "misc.h" #include "Game.h" #include "Support.h" @@ -89,19 +88,6 @@ void Game::Splat(int k) alSourcePlay(gSourceID[headwhacksound]); } -void Game::saveHighScore() -{ - if (score > highscore) { - highscore = score; - /* TODO */ - std::ofstream opstream("highscore.txt"); - opstream << highscore; - opstream << "\n"; - opstream << beatgame; - opstream.close(); - } -} - void Game::updateSong() { if (environment == rainy_environment) @@ -175,7 +161,6 @@ void click(Game* game, int button, int action, int mods) } alSourcePlay(gSourceID[losesound]); - game->saveHighScore(); break; } return; @@ -457,6 +442,7 @@ void Game::Tick() if (timeremaining <= 0) { score += ++mission * 50 + 100; + highscore = max(score, highscore); flashamount = flashg = 1; flashr = flashb = 0; @@ -477,7 +463,6 @@ void Game::Tick() setMenu(this, beatgame = true); gameinprogress = 0; - saveHighScore(); } else { updateSong(); initGame(this); |
