I guess it's a matter of making event organization really easy and clean. For instance, you can have one function that deals with all
KeyPressed events, and another function that deals with all
KeyReleased events, something like this:
while (m_window->pollEvent(event))
{
switch (event.type)
{
case sf::Event::KeyPressed:
{
handleKeyPresses(event);
break;
}
case sf::Event::KeyReleased:
{
handleKeyReleases(event);
break;
}
}
}
The separation of those handlers will make your code more neat.
handleKeyPresses(sf::Event& event)
{
switch (event.key.code)
{
case sf::Keyboard::Space:
{
activateBomb;
handleKeyReleases(sf::Event& event)
{
switch (event.key.code)
{
case sf::Keyboard::Space:
{
deactivateBomb;