Being new to SFML, my friend recommended my first step being making a simple pong game. I've been trying to figure it out on my own using only the SFML tutorials from the Learn section of the website, but I've run into an issue and I can't find a solution to it in all my googling. I'm trying to make both paddles movable to make it a 2-player game, but for some reason the paddles move at different speeds. The Top paddle is bound to Left and Right to move 10 pixels in either direction, and the bottom paddles are bound to 'A' and 'D' and are set to move the same distance, however they move twice as far on a single key press. When both paddles are moving at the same time, they move the same speed. It's only when they're moving at different times that the bottom paddle moves much quicker. Anyone have any words of insight for a newbie on the matter? This is what I'm using for the movement.
if (sf::Keyboard::isKeyPressed(sf::Keyboard:: Left))
{
pad1.move(-10, 0);
}
else if (sf::Keyboard::isKeyPressed(sf::Keyboard:: Right))
{
pad1.move(10, 0);
}
if (sf::Keyboard::isKeyPressed(sf::Keyboard:: A))
{
pad2.move(-10, 0);
}
else if (sf::Keyboard::isKeyPressed(sf::Keyboard:: D))
{
pad2.move(10, 0);
}