I've been trying to figure out how to solve this problem for a while and I still can't figure out how to fix it.
I've been looking for a way to permanently change the variable using the sf::Mouse click function:
//example
int main()
{
int I = 0; // variable I'm going to change
//window, and the game loop here
if (sf::Mouse::isButtonPressed(sf::Mouse::Left))
{
i += 1; // how i'm going to change the variable
}
//I is printed to the console to check the value
}
so the problem here is when I click my mouse, i is added by one and now is equal to one, here's the thing. Once I stop clicking i turns right back into 0. Is there something i missed over that could have been useful to fix this problem? Anything could help.