Hi there,
currently I’m building my first game, after doing some tutorials on making sprites and programming in C# (I have basic experience in programming).
Everything is working fine and I managed to get a player animation running in multiple directions. Now I am trying to pause the animation while the player is standing still (it now keeps looping as walking while standing still)
I thought of building a pause for now, which is pausing the animation at the first frame when true.
This is working properly now.
However the following doesnt work:
if (keyboardState.IsKeyDown(Keys.None)) { AnimationLeft.Pause = true; AnimationRight.Pause = true; AnimationDown.Pause = true; AnimationUp.Pause = true; }
When using any other key it pauses the animations which works like a charm.
So I used some console.Writeline to debug.
Console.WriteLine(keyboardState.IsKeyDown(Keys.None)); Console.WriteLine(keyboardState.GetPressedKeys());
The above returns the following during running:
False Microsoft.Xna.Framework.Input.Keys[]
So now my question is why the keys.None is returning a false, where if I request the pressed keys I get none.
Can anybody help me out here?
Additionaly,
I want to start working from a single animation-instance of player movement but still thinking a proper method, tips are welcome