I'm only a newbie, but how could I make a sprite 'jump', where when a key is pressed it goes up then down? I'm not sure how one would do this (maybe theres an obvious method
). I tried this code but it didn't really work...
if (sf::Keyboard::isKeyPressed(sf::keyboard::Space))
{
sprite.move(0, -0.5);
Sleep(1000);
sprite.move(0, 0.5);
}
I know it's obvious what I tried to do wouldnt work, but I'm a bit stuck on this :-/