Hi, I'm working on a game and I'm stuck on Movement
I have the following code in my main.cpp
if(sf::Keyboard::isKeyPressed(sf::Keyboard::Left)) sprite.move(-20,0);
if(sf::Keyboard::isKeyPressed(sf::Keyboard::Right)) sprite.move(20,0);
if(sf::Keyboard::isKeyPressed(sf::Keyboard::Up)) sprite.move(0,-20);
if(sf::Keyboard::isKeyPressed(sf::Keyboard::Down)) sprite.move(0,20);
Im just trying to figure out, why it isn't allowing me to move the sprite continually. Would I need to do something like
float speed = 5.f;
?
Thanks in advance.