Need Help Using State Variable
Posted: Mon Aug 30, 2010 3:31 am
So here's my problem: I have six animations, though there will be plenty more after I get this initial issue sorted out, and I am using a "state" variable to manage my character's animations, and so far, I have been successful at using the switch statement to regulate between standing and walking left and right, which occupies cases 0-3, but for some reason, no matter what I try, I can't get the down key to register my ducking animation, even though the code says it should be working, as far as I can tell, and for some reason, in a few of the combinations I have tried, the down key has reacted only if I was holding the left or right key at the same time, and I can't figure out why.
To make things worse, I would like to eventually implement a fluid turning and ducking animation to transition between states, but I have no idea how I will make that work when I can't even get the switch statement to recognize the variables properly, or my down key to even register my duck animation.
Any ideas why this might be happening, or suggestions for better ways to manage complex movement?
To make things worse, I would like to eventually implement a fluid turning and ducking animation to transition between states, but I have no idea how I will make that work when I can't even get the switch statement to recognize the variables properly, or my down key to even register my duck animation.
Any ideas why this might be happening, or suggestions for better ways to manage complex movement?