1
Graphics / Re: Projectile
« on: October 10, 2017, 06:12:08 pm »
It's inside of the second while loop,
I tried moving the break from outside of the third switch to inside of the curly braces, but it still does the same thing.
while (window.isOpen())
{
clock2.restart();
sf::Event evnt;
while (window.pollEvent(evnt))
{
switch (evnt.type)
{
case sf::Event::Closed:
window.close();
break;
case sf::Event::KeyPressed:
if (evnt.key.code == sf::Keyboard::Space)
{
isJump = true;
CreateSoundJump();
}
if (evnt.key.code == sf::Keyboard::Return)
{
dIsVisible = false;
}
if (evnt.key.code == sf::Keyboard::F)
{
CreateAbilitySound();
orbMovement = true;
break;
}
}
}
{
clock2.restart();
sf::Event evnt;
while (window.pollEvent(evnt))
{
switch (evnt.type)
{
case sf::Event::Closed:
window.close();
break;
case sf::Event::KeyPressed:
if (evnt.key.code == sf::Keyboard::Space)
{
isJump = true;
CreateSoundJump();
}
if (evnt.key.code == sf::Keyboard::Return)
{
dIsVisible = false;
}
if (evnt.key.code == sf::Keyboard::F)
{
CreateAbilitySound();
orbMovement = true;
break;
}
}
}
I tried moving the break from outside of the third switch to inside of the curly braces, but it still does the same thing.