1
\$\begingroup\$

This question already has an answer here:

I want to create top down game where you are Russian soldier in libGDX. The player controls the soldier with W/A/S/D and aims with the mouse. That way the soldier can run sideways and shoot towards enemy.

What is best way to make his legs walk into the right direction but aim the weapon towards the mouse pointer?

My idea is to make two sprites, for both torso/weapon and legs and let them lay over each other but I don't know if that is best way to do it.

\$\endgroup\$

marked as duplicate by Anko, Seth Battin, MrCranky, MichaelHouse Mar 28 '14 at 17:36

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1
\$\begingroup\$

Your solution is probably the easiest way to do it and I see no reason of why it wouldn't be valid. If you use only one sprite for a character this will mean that you will have to do a sprite per walking-direction/firing-direction combination pair.

In the case of a character viewed from the side you can use deformation to deform the sprite in the correct pose (They do this in Rayman origin), but this is very difficult to look right for little visual gain, and little time gain over painting each half-sprite in your case.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.