From bd321d051ca8c827a5c8a490afc33812e76abba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= Date: Wed, 20 Oct 2021 23:19:17 +0700 Subject: Move scores tracking to user data --- src/GameTick.cpp | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'src/GameTick.cpp') 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 #include -#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); -- cgit v1.2.3