I want to ask for help that I don't know how to use if for position in sfml.
For example, if I want something to go as long as it is given inside the if.
I have this code:
#include <SFML\Graphics.hpp>
#include<SFML\Audio.hpp>
#include<SFML\Network.hpp>
int main{
sf::RenderWindow window(sf::VideoMode(1080, 600), "sfml tutorial", sf::Style::Close | sf::Style::Resize);
sf::View Player1(sf::Vector2f(-32.f, 0.f), sf::Vector2f(512.f, 512.f));
sf::RectangleShape slot1(sf::Vector2f(64.f, 128.f));
slot1.setPosition(-264.f, 128.f);
while(window.isOpen())
{
sf::Event evnt;
while(window.pollEvent(evnt))
{
if(evnt.type == evnt.Closed)
{
window.close();
}
}
window.draw(slot1);
window.display();
}
}
return 0;
}
I want make one animation with this Rectangle, while something Dont true.
Sorry for my english.