Hello,
Here is the problem I have , I want to make something move from one lane to another , for that in a loop for window.isOpen() in the pollEvent loop I use this code , wich seemed pretty good to me :
if(sf::Keyboard::isKeyPressed(sf::Keyboard::Up)){
player.moveLane(UP);
}
if(sf::Keyboard::isKeyPressed(sf::Keyboard::Down)){
player.moveLane(DOWN);
}
But the problem here is that on the next occurence of the isOpen loop , it will try again to move , so the player moves twice , while pressing one key. So my idea was too make the player move one lane when pressing the key , how do you do that if this code doesn't work ?
And thhanks to anyone looking here