1
General / Re: Permanently changing a variable with sf::Mouse click
« on: April 14, 2020, 12:22:02 am »
Oh sorry, I put the i variable before the game loop:
//edited example
int main()
{
//window, and the game loop here
int I = 0; // variable I'm going to change
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
}
this is what I meant to show
int main()
{
//window, and the game loop here
int I = 0; // variable I'm going to change
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
}