07/03/13

Today I've worked on the animation in my game, I've planned to add an
"AnimationStateManager" class but in the end I've only edited the
"DynamicObject" class as I don't want to separate the body and the
animation of an object. I've replaced the top and base animationstate
variables with _DefaultAnimation and _AdditionalAnimation, I've also
added an AnimationPlan object for the _AdditionalAnimation. The
_DefaultAnimation is as the name indicates a default animation state
which will be used if no additional animation is specified. The
_AdditionalAnimation is an additional state for things like attacks and
jump, it can either override or overlap the default animation
(specified in the _AnimationPlan variable).  I've also added an
AnimationStates struct which will specify model specific animation names

for different animations if available. I've added set functions for the
new animation states and a separate update function for the animations.
These changes allowed me to easily change the model's animation from
outside of it's class however there are still a number of problems with
this solution:

1. There is only one additional animation so it's impossible to properly
animate a jump and an attack at the same time.
2. Default animation cannot be changed when an additional one is active,
therefor if the player jumps while running and stops moving in the air
the model will still animate the running after landing.