Advances to the next level again
authorHeli Hyvättinen <heli.hyvattinen@kymp.net>
Wed, 7 Sep 2011 11:05:09 +0000 (14:05 +0300)
committerHeli Hyvättinen <heli.hyvattinen@kymp.net>
Wed, 7 Sep 2011 11:05:09 +0000 (14:05 +0300)
seascene.cpp

index ee4c334..580d4b0 100644 (file)
@@ -423,9 +423,22 @@ void SeaScene::handleScreenTapped()
         {
             pAboutBoxItem_->hide();
             pPausetextItem_->show();
+            return;
         }
     }
 
+    //If the game is paused, check if the level completed item is shown
+
+    if (pLevelCompletedItem_)
+    {
+        if (pLevelCompletedItem_->isVisible())
+        {
+            pLevelCompletedItem_->hide();
+            restartLevel(); //Current level has already been set to the next one before showing the level completed item
+            pPauseAction_->setChecked(false); //unpause
+            return;
+        }
+    }
   
     //If the game is paused, check if the victory item is being shown
     if(pVictoryCongratulationsItem_)
@@ -439,6 +452,7 @@ void SeaScene::handleScreenTapped()
         }
     }
 
+
     //If the game is paused and no victory, check if menu item was selected
 
     QList<QGraphicsItem *> items = selectedItems();