Hi amanuel2,
The sprite sheet you are working is 3x4, so there are 3 animation frames for each direction and 4 directions.
Row 1 are the walking down frames
Row 2 are the walking left frames
Row 3 are the walking right frames
Row 4 are the walking up frames
The screen coordinate system is different than the cartesian coordinate system you may have learned in math. X still increases as you go right but Y increases as you go DOWN.
When you are checking the keyboard for the direction pressed, it is setting source.x and source.y. X is always set to 0 in the switch statement so it will start with the first frame for that direction. Y is set to 0,1,2, or 3 to pick the row for the appropriate direction.
When you call _sprite.setTextureRect at the bottom you are "isolating" the first frame for the direction you chose for display purposes.
To get to the next frame for that direction, you need the second piece of code you wrote
source.x++;
// This line increased X from 0 to 1
// This means that the next time you call
// setTextureRect it will pass 1*SPRITE_WIDTH
// instead of 0xSPRITE_WIDTH. This has the effect
// of picking the frame 32 pixels to the right which is
// essentially the next frame of that direction.
if (source.x * 32 >= _texture.getSize().x)
// Once the multiplication produces a number of pixels
// that is greater than the size of the texture, that means
// it has already gone through all of the frames for that
// direction and needs to start at 0 again for the first frame
source.x = 0;