This looks to be where you're trying to toggle between different balloon sprites, but there are quite a few issues with it.
if (elapsed.asSeconds() <= 1){
while (window.isOpen()) {
activeSprite = (activeSprite == &balloon4Sprite ?
&balloon2Sprite :
&balloon4Sprite);
}
}
- This is directly in your main function, not in your main "game loop". You will only hit this if statement one time. You will presumably enter the if statement's body because the time elapsed will likely be under 1 second by this point.
- After entering the body of the if statement you will be rapidly switching the sprite back and forth as fast as your CPU can go in the while loop, which is likely not what you want. It seems like you want the if statement to be inside your while loop, not the other way around.
- You are never drawing the sprites and displaying the window between each time you toggle the sprite. You will therefore not see anything happen on screen.
- You have two of these loops: while (window.isOpen()). You are only handling events and drawing things in the second one. You need combine the two loops into one.