so I have a head of a snake which can pose in 4 different states, with the face up, down, left and right , what I wanted to do is make use of rotations to rotate the head so that it faces the desired directions without changing the position of the head on the screen
I have made a workaround using texture rectangle...
if (mIsMovingUp)
{
movement.y -= mPlayerSpeed;
//how ?
}
if (mIsMovingDown)
{
movement.y += mPlayerSpeed;
//how ?
}
if (mIsMovingLeft)
{
movement.x -= mPlayerSpeed;
mPlayer[0].setTextureRect(sf::IntRect(64, 0, -32, 32));
//sprite face left
}
if (mIsMovingRight)
{
movement.x += mPlayerSpeed;
mPlayer[0].setTextureRect(sf::IntRect(32, 0, 32, 32));
//sprite face right
}