Got it, also is it better to
sf::Event event;
while (win.pollEvent(event))
{
if (event.type == sf::Event::KeyPressed)
{
if (event.key.code == sf::Keyboard::Space) chara.jump();
}
}
or
sf::Event event;
if (win.pollEvent(event))
{
if (event.type == sf::Event::KeyPressed)
{
if (event.key.code == sf::Keyboard::Space) chara.jump();
}
}