Commits

Felix Bečeić committed c0670ae

Added back to main menu button in credits.

Comments (0)

Files changed (3)

 #include "texture.h"
 #include "gm_level.h"
 #include "gm_credits.h"
+#include "gm_mainmenu.h"
 #include "gamemode.h"
 
 extern bool gRunning;
     return false;
 }
 
-///////////////////////////////
-
+////////////////////////////////
 bool ExitButton::handleClick()
 {
-    gRunning = 0;
+    gRunning = false;
     return true;
 }
 ///////////////////////////////
     gGame->switchGameMode(new GM_Credits());
     return true;
 }
-
+////////////////////////////////
+bool BackToMainMenuButton::handleClick()
+{
+    gGame->switchGameMode(new GM_MainMenu());
+    return true;
+}
     bool handleClick();
 };
 
+class BackToMainMenuButton : public Button
+{
+    public:
+    BackToMainMenuButton(const std::string& textureFile,
+                         const double x,
+                         const double y) :
+                         Button(textureFile, x, y)
+    {
+    }
+    bool handleClick();
+};
+
 #endif
 extern bool gRunning;
 extern SDL_Surface * gScreen;
 
-
 GM_Credits::GM_Credits()
 {
     Layer *layer(new Layer("background.png", gScreen->w / 2,gScreen->h / 2));
     Layer *layer2(new Layer("credits.png", gScreen->w / 2, gScreen->h * 1.5));
     this->layers.push_back(layer2);
 
-    Button *exitButton(new ExitButton("exitbutton.png", 130, 335));
+    Button *exitButton(new BackToMainMenuButton("mainmenubutton.png", 130, 335));
     this->buttons.push_back(exitButton);