Hello forum, I was wondering if someone could check my pseudo?
I'm working the animation system for a top down shooter, the character is currently split into 3 layers (Lower body, upper body and head) all stacked on top of each other; the following is my attempt to work out how the lower body (The feet) will work:
It's currently contains two animations; Walk Forward, which shows the feet moving back and forth, and Walk Sideways which shows the feet strafing. It's my intention to have the Walk Forward animation play when the player is moving forward or backwards, and Walk Sideways when moving sideways.
I naively thought that simple assigning the animations to key presses would work, but my sprites draw their angle from the mouse, and therefore it is possible for the player to push the "W" key (Which moves forwards from the default angle) and move sideways in relation to the mouse angle, this obviously creates problems.
Below is a quick diagram I threw together to work out the animations:
<img src="http://s16.postimage.org/qe80o2rx1/DRAFT.png" border="0" />
My plan is to create 8 events, WF1-4 and WS1-4: The diagram above demonstrates the conditions for each event, for example:
If the angle is between A8(315) and A1(45)and W is pressed, Walk Forward will play; if not (Else) Walk Sideways will play. The condition being the angle.
After writing all of this my head hurts... I have a good feeling I'm severely over-complicating things; please help!