This is my first sfml project and I am attempting to make a doodle jump clone but I can't figure out how to make the sprite automatically jump. It just stops in the air after one jump. Any help would be appreciated
This is what my jumping function looks like
void Doodle::Jump(sf::RenderWindow &window)
{
if(getSpritePos().y > window.getPosition().y)
{
mSprite.move(mVelocity);
}
if(getSprite().getGlobalBounds().intersects(mBottom.getGlobalBounds()))
{
mVelocity.y-=mGravity.y*acceleration.y;
mSprite.move(mVelocity);
}
if(mVelocity.y<=0)
{
mVelocity.y=-5.0f;
}
}