Integrating animation

Hello all!

I currently have this demo:

I need to make the character in the above demo integrate with the keyboard controls like it does in this one:


Hello can you be more precise? Maybe with a PG so we can focus on the question with simpler code?