How do you compute where you have to aim to hit a moving target with a finite-speed projectile? This is a common question on gamedev.net's forums. This article presents a procedure to solve this problem and some variations thereof.
leading the target
Performing smooth animation transitions in response to user input is a complicated problem. By using synchronized state machines, you can specify allowed behavior in an organized way, and have the computer handle combining of the behavior.