From a28bf11ca62e1b2171f5c4898be7c8598c84dbde Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 8 Nov 2019 17:16:57 +0100 Subject: GRIFFON: Initial code for game modes --- engines/griffon/griffon.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'engines/griffon/griffon.cpp') diff --git a/engines/griffon/griffon.cpp b/engines/griffon/griffon.cpp index 118ff0e846..264d0f0c6e 100644 --- a/engines/griffon/griffon.cpp +++ b/engines/griffon/griffon.cpp @@ -59,7 +59,7 @@ GriffonEngine::GriffonEngine(OSystem *syst) : Engine(syst) { _mixer = nullptr; _shouldQuit = false; - _gameEnd = false; + _gameMode = kGameModeIntro; _musicChannel = -1; _menuChannel = -1; @@ -138,11 +138,27 @@ Common::Error GriffonEngine::run() { return Common::kNoError; while (!_shouldQuit) { - _gameEnd = false; - title(0); - if (!_shouldQuit && !_gameEnd) + if (_gameMode == kGameModeNewGame) { + newGame(); + } else if (_gameMode == kGameModeLoadGame) { + _player.walkSpeed = 1.1f; + _animSpeed = 0.5f; + _attacking = false; + _player.attackSpeed = 1.5f; + + _playingGardens = false; + _playingBoss = false; + + haltSoundChannel(-1); + + _secsInGame = 0; + loadMap(_curMap); + mainLoop(); + } + + if (!_shouldQuit && _gameMode != kGameModeEnd) saveLoadNew(); } -- cgit v1.2.3