Hello there.
I have been having a bit of a problem that seems quite hard for me to handle in switching frames on key pressed buttons.
In the code, I have created an enum that has five commands "Up, Down,Left, Right, Attack". When the command attack is initiated, I cannot bring the sprite back to the way it was before attacking.
My code :
else if(sf::Keyboard::isKeyPressed(sf::Keyboard::Space))
{
source.y=Attack;
if(Event.type==sf::Event::KeyReleased && Event.key.code==sf::Keyboard::Space)
source.y=Left;
}
I cannot understand why it cannot check the condition there