aboutsummaryrefslogtreecommitdiff
path: root/engines/avalanche
diff options
context:
space:
mode:
authoruruk2013-12-20 08:46:47 +0100
committeruruk2013-12-20 08:46:47 +0100
commitf83de4fbfe655591186eb0c4e2df87b1695e9fe9 (patch)
treeb7994ec55f1b071a216fd04adda9043b1f3aff9f /engines/avalanche
parentf9684f98f753e1360a00d22364a395f71ba1839c (diff)
downloadscummvm-rg350-f83de4fbfe655591186eb0c4e2df87b1695e9fe9.tar.gz
scummvm-rg350-f83de4fbfe655591186eb0c4e2df87b1695e9fe9.tar.bz2
scummvm-rg350-f83de4fbfe655591186eb0c4e2df87b1695e9fe9.zip
AVALANCHE: Implement Nim::endOfGame().
Diffstat (limited to 'engines/avalanche')
-rw-r--r--engines/avalanche/nim.cpp20
-rw-r--r--engines/avalanche/nim.h2
2 files changed, 20 insertions, 2 deletions
diff --git a/engines/avalanche/nim.cpp b/engines/avalanche/nim.cpp
index 256c713edd..a7abfa391f 100644
--- a/engines/avalanche/nim.cpp
+++ b/engines/avalanche/nim.cpp
@@ -226,6 +226,7 @@ bool Nim::checkMouse() {
Common::Point cursorPos = _vm->getMousePos();
_vm->_graphics->refreshScreen();
Common::Event event;
+ // This loop needs "some" revision!!!
while (_vm->getEvent(event)) {
_vm->_graphics->refreshScreen();
if (event.type == Common::EVENT_LBUTTONUP) {
@@ -283,7 +284,24 @@ void Nim::takeSome() {
}
void Nim::endOfGame() {
- warning("STUB: Nim::endOfGame()");
+ CursorMan.showMouse(false);
+
+ chalk(595, 55 + _turns * 10, "Wins!");
+ _vm->_graphics->drawNormalText("- - - Press any key... - - -", _vm->_font, 8, 100, 190, kColorYellow);
+
+ Common::Event event;
+ bool escape = false;
+ while (!_vm->shouldQuit() && !escape) {
+ _vm->_graphics->refreshScreen();
+ while (_vm->getEvent(event)) {
+ if ((event.type == Common::EVENT_LBUTTONUP) || (event.type == Common::EVENT_KEYDOWN)) {
+ escape = true;
+ break;
+ }
+ }
+ }
+
+ CursorMan.showMouse(true);
}
bool Nim::find(byte x) {
diff --git a/engines/avalanche/nim.h b/engines/avalanche/nim.h
index b756460a36..6afb915e47 100644
--- a/engines/avalanche/nim.h
+++ b/engines/avalanche/nim.h
@@ -71,7 +71,7 @@ private:
void endOfGame();
bool find(byte x); // This gives TRUE if there's a pile with x stones in.
void findAp(byte start, byte stepSize);
- void dogFood();
+ void dogFood(); // AI procedure to play the game.
};
} // End of namespace Avalanche