From 8cf4c302fe4ac3923e24d81aa387986301d045ae Mon Sep 17 00:00:00 2001 From: Thomas R Date: Wed, 12 Jan 2022 16:56:42 +0100 Subject: [PATCH 1/2] pls let me die --- headers/game.h | 7 ++++++- src/gameBasics.cpp | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/headers/game.h b/headers/game.h index 20a7b5a..b623f0c 100644 --- a/headers/game.h +++ b/headers/game.h @@ -38,7 +38,12 @@ private: * @brief the MinGL window in which the game will be drawn into */ MinGL window; - + + /*! + * @brief Harcoded window size + */ + const Position winSize{1280,720}; + /*! * @brief PixelManager : Class that contains and draws all the data that will be drawn on screen * This is a pointer because the object is allocated at runtime, following the configuration diff --git a/src/gameBasics.cpp b/src/gameBasics.cpp index 6f17db1..6fbc9b6 100644 --- a/src/gameBasics.cpp +++ b/src/gameBasics.cpp @@ -15,7 +15,7 @@ #include "playMode.h" #include "goodPixelManager.h" -#define WININIT window("SUPER Space Invader : Turbo Apocalypse DX - VS GOD", Position(1280, 720), Position(128, 128), nsGraphics::KBlack) +#define WININIT window("SUPER Space Invader : Turbo Apocalypse DX - VS GOD", Position(1280, 720) /*for some reason I can't use the winSize member here*/, Position(128, 128), nsGraphics::KBlack) Game::Game() : WININIT { @@ -128,6 +128,9 @@ WinValue Game::enterGameLoop(){ // returns when game is finished fpsStartTime = startTime; } + // force window size + if(window.getWindowSize()!=winSize)window.setWindowSize(winSize); + pm->startFrame(); managePlayers(); From e6c7ea3e9acbbb867cb003ff649ccf9b6b62e439 Mon Sep 17 00:00:00 2001 From: Thomas R Date: Wed, 12 Jan 2022 20:07:57 +0100 Subject: [PATCH 2/2] bug --- src/gameManagers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gameManagers.cpp b/src/gameManagers.cpp index abfe630..e0f222c 100644 --- a/src/gameManagers.cpp +++ b/src/gameManagers.cpp @@ -105,10 +105,10 @@ bool Game::manageInvaders(){ void Game::remCollidingProjectiles(){ auto miss = missiles.begin(); - auto tor = torpedos.begin(); while(miss != missiles.end()){ bool wasColliding = false; + auto tor = torpedos.begin(); while(tor != torpedos.end()){ // missiles can't be right under torpedos, so that must means they are colliding in Y