31
General / Re: [Q] Proper way to slow down a Sprite during movement?
« on: May 11, 2016, 04:51:00 am »
Hi,
Ah, it makes more sense now if this is a class project why the code would look this way.
The delay might be coming from the fact you are repeatedly loading the same texture from the same file during every key press and key release.
You could try loading linktexture ONCE in the entire program before the loop starts and then just setting the texture rectangle within the "if statements" like you are already doing to see if clears the delay.
As a side note, not to ask personal questions, but I'm somewhat curious what kind of awesome school is teaching SFML
Ah, it makes more sense now if this is a class project why the code would look this way.
The delay might be coming from the fact you are repeatedly loading the same texture from the same file during every key press and key release.
You could try loading linktexture ONCE in the entire program before the loop starts and then just setting the texture rectangle within the "if statements" like you are already doing to see if clears the delay.
As a side note, not to ask personal questions, but I'm somewhat curious what kind of awesome school is teaching SFML