I am creating a simple game to move a sprite using keyboard buttons (ASDW) and I am using OOP principles in my code. Everything seems fine and there's no syntax error but when I run the code the sprite is not moving at all.
here is a piece of my code for controlling keyboard event:
void Game::proccessEvent()
{
sf::Event event;
while (mWindow.pollEvent(event)) {
switch (event.type) {
case sf::Event::Closed:
mWindow.close();
break;
case sf::Event::KeyPressed:
handlePlayerInput(event.key.code, true);
break;
case sf::Event::KeyReleased:
handlePlayerInput(event.key.code, true);
break;
default:
break;
}
}
}
I also pasted my whole code in this link: https://pastebin.com/N9EH9yLi
Can anyone please help me out of this? I am confused.