Currently, I am implementing the 'Start Over' and 'Paused' buttons that will pop up when you lose or pause the game.
The Start Over button works fine, but I have a strange problem with Paused:
when you push 'p' it should pop up as well as pause the game. However, currently if you push 'p' once, it will only pause the game. Only if you then push 'p' a second time, the button will show.
After it shows, you can click the button to resume the game and the button is set to invisible (which is working correctly).
My code is as follows:
1) initialization function:
creates the buttons and sets them to Visible(false)
2) update function:
Code: Select all
if(m_mode == GSM_MODE_PLAY) {
if(keys[irr::KEY_KEY_P]) { //game pause
m_btn_paused->setVisible(true);
m_mode = GSM_MODE_PAUSED;
return;
}
wierd?!