I have a sprite sheet that contains a character walk cycle, and I have made a player class that allows the player to move and cycle through the walk animation, however the animation only works whilst walking to the right. I use the arrow keys to move up, down, left and right, meaning when I press any key, my player moves in the correct direction, but only performs the animation of walking to the right.
The current animation that works, has been called like this in the
spritesheet = Content.Load<Texture2D>("sprites2"); player = new Player(spritesheet, new Rectangle(0, 96, 32, 48), new Vector2(100, 100), 4);
This does its job, as it calls each 4 sprites to complete the walking animation to the right, and
new Rectangle(0,96,32,48) is the location cut out from the sprite sheet. However I need (for example)
new Rectangle(30, 101, 65, 52) to be used also, which will correctly animate my character when the left arrow key has been pressed.
My question is, how would I get another location of the sprite sheet loaded, and then actually work when I press the correct key?
This is a very difficult question to ask and I very much apologize if it was difficult to understand. Accepting all edits to my question, and thank you in advanced.