To switch between a splash,a title and a menu screen i wanted to use switch with an integer.If the space key would have been pressed,the int value would be increased:
int Screen;
while (window.isOpen())
{
Event event;
while (window.pollEvent(event))
{
if (event.type == Event::Closed){ window.close(); }
}
if(Keyboard::isKeyPressed(Keyboard::Space)){Screen+1;}
window.clear();
switch (Screen)
{
case 0:
window.draw(Sp_Splash);
break;
case 1:
window.draw(Sp_Title);
break;
default:
break;
}
window.display();
}
But when i press space nothing happens(the Screen does not change).
Does anyone know why?