Hello,
I made a program where you can press the arrow keys to move an item, and if you press "Q" the item would rotate,
I noticed i could not have the item MOVE and rotate at the same time if i pressed an arrow key and 'Q' at the same time. Is that normal?
Here is the code :
while (window.isOpen())
{
...
...
sf::Event event;
while (window.pollEvent(event))
{
if(event.type==sf::Event::KeyPressed&&event.key.code==sf::Keyboard::Q)
{
pivot(RightObj,ang,sf::Vector2f(saveCenter1,saveCenter2),3);
pivot(LeftObj,ang,sf::Vector2f(saveCenter1,saveCenter2),3);
// save= ang+save;
}
if(event.type==sf::Event::KeyPressed&&event.key.code==sf::Keyboard::Right)
{
shiftVertex(RightObj,10,'r',3);
shiftVertex(LeftObj,10,'r',3);
}
...
...
}
It's quiiite frustrating, i want to make a reeally dynamic game where you can press many keys and ave many actions happen.