]> git.uio.no Git - private-olgabo.git/commitdiff
sc
authorolgabo <olgabo@ifi.uio.no>
Fri, 26 Oct 2012 21:10:43 +0000 (23:10 +0200)
committerolgabo <olgabo@ifi.uio.no>
Fri, 26 Oct 2012 21:10:43 +0000 (23:10 +0200)
projects/dumbclient/Game.cpp

index 5f3a62cf9dd8db5f24a5a93947e306259dc771e6..7629bac53ce618b98ee76d6653a7a293e569abbd 100644 (file)
@@ -580,9 +580,11 @@ bool Game::frameRenderingQueued(const FrameEvent &evt)
             cameraNode->pitch(Degree(90), Node::TS_LOCAL);
             gameOver = true;
             msgBoard->setCaption("You were killed. Game over :| (Press Esc)");
-            gettimeofday(&msgTime, NULL);
+            //gettimeofday(&msgTime, NULL);
             gameOver = true;
             bool ret = BaseApplication::frameRenderingQueued(evt);
+
+
     
             return ret;
          //   exit();
@@ -1893,7 +1895,7 @@ void Game::printStepsLeft()
         localPlayer->PunchesReceivedAck >= 10 &&
         localPlayer->WavesReceivedAck >= 10)
     {
-        SceneNode* board = mSceneMgr->getSceneNode("MsgBoard");
+      /*  SceneNode* board = mSceneMgr->getSceneNode("MsgBoard");
         board->detachAllObjects();
         board->_update(true,true);
         /*msgBoard->detachFromParent();
@@ -2188,13 +2190,21 @@ void Game::printTime()
     struct timeval now;
     struct timeval timeLeft;
     gettimeofday(&now, NULL);
-   
-    timersub(&gameEnd, &now, &timeLeft);
-    caption = caption + StringConverter::toString(timeLeft.tv_sec);
+    if (gameOver)
+    {
+        caption = caption + "0";
+    }
+    else
+    {
+        timersub(&gameEnd, &now, &timeLeft);
+        caption = caption + StringConverter::toString(timeLeft.tv_sec);
     
+        
+        if (timeLeft.tv_sec <= 0)
+            exit();
+    }
     timeBoard->setCaption(caption);
-    if (timeLeft.tv_sec <= 0)
-        exit();
+    
 }