fix button for pause menu opening

This commit is contained in:
arthur.jamet
2021-06-08 16:21:03 +02:00
parent 1e5d97f831
commit 29690b3744
3 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ bool RAY::Window::open(void)
} }
InitWindow(this->_dimensions.x, this->_dimensions.y, this->_title.c_str()); InitWindow(this->_dimensions.x, this->_dimensions.y, this->_title.c_str());
this->_isOpen = true; this->_isOpen = true;
//this->setExitKey(Controller::Keyboard::Key::KEY_M); this->setExitKey(Controller::Keyboard::Key::KEY_DELETE);
return true; return true;
} }
@@ -21,7 +21,7 @@ namespace BBM
//! @brief bomb key //! @brief bomb key
Key keyBomb = KEY_E; Key keyBomb = KEY_E;
//! @brief pause key //! @brief pause key
Key keyPause = KEY_M; Key keyPause = RAY::Controller::Keyboard::Key::KEY_ESCAPE;
//! @brief move right key //! @brief move right key
Key keyRight = KEY_A; Key keyRight = KEY_A;
//! @brief move left key //! @brief move left key
+3 -2
View File
@@ -67,6 +67,7 @@ namespace BBM
return; return;
gameState._loadedScenes[gameState.currentScene] = engine.scene; gameState._loadedScenes[gameState.currentScene] = engine.scene;
engine.scene = gameState._loadedScenes[gameState.nextScene]; engine.scene = gameState._loadedScenes[gameState.nextScene];
gameState.currentScene = gameState.nextScene;
} }
void Runner::addSystems(WAL::Wal &wal) void Runner::addSystems(WAL::Wal &wal)
@@ -210,9 +211,9 @@ namespace BBM
scene->addEntity("background") scene->addEntity("background")
.addComponent<PositionComponent>() .addComponent<PositionComponent>()
.addComponent<Drawable2DComponent, RAY::Texture>("assets/plain_menu_background.png"); .addComponent<Drawable2DComponent, RAY::Texture>("assets/plain_menu_background.png");
scene->addEntity("logo") scene->addEntity("pause text")
.addComponent<PositionComponent>(1920 / 3, 180, 0) .addComponent<PositionComponent>(1920 / 3, 180, 0)
.addComponent<Drawable2DComponent, RAY::Texture>("assets/logo_small.png"); .addComponent<Drawable2DComponent, RAY2D::Text>("PAUSE", 120, RAY::Vector2(), ORANGE);
auto &play = scene->addEntity("play button") auto &play = scene->addEntity("play button")
.addComponent<PositionComponent>(1920 / 2.5, 1080 - 540, 0) .addComponent<PositionComponent>(1920 / 2.5, 1080 - 540, 0)
.addComponent<Drawable2DComponent, RAY::Texture>("assets/buttons/button_back.png") .addComponent<Drawable2DComponent, RAY::Texture>("assets/buttons/button_back.png")