1 2 3 4 5 6 7
|
if (sf::Keyboard::isKeyPressed(sf::Keyboard::O))
{
overRideFrame.SetNewFrames(5.0f);
cout << overRideFrame.frames << endl;
}
| |
Temporarily change private to public so you can edit the function as I've posted, then tell me what you see.
Alternatively, instead, if you don't like changing private to public, do this:
|
void SetNewFrames(float newFrame) { frames = newFrame; cout << "SetNewFrames " << frames << endl; };
| |
Now, I know the kind of problem you're having. I, myself, some 38 years ago, would have sworn the computer was actively refusing to do what I wrote. Something that simply MUST work wasn't.
It's never once been true.
I've seen people swear on their life the computer is simply refusing to execute their code.
It has never been the case.
I suspect overRideFrame is not the object you're checking after you change it here.