Y
Yoo
Guest
If I made it so that if I click the right key (or in my case 'D'), object will move to the right. While I'm holding the right key, object changes to the sprite that is animation for the movement to the right. Once I release the right key, the object stops moving, and transforms to the sprite that is idle animation for facing the right direction. And vice versa for the left side and the left key (in my case 'A').
I want to, besides WASD movement keys, and Space bar for jumping and similar, to use a mouse in my game. So that, once I click the left mouse button it does something... for now, just the animation (or the sprite). And the same for the right mouse click as well.
But how to do it, so that if I am facing right (or moving to the right), once I click the left mouse button I get the animation facing right, and again, vice versa for the left side.
If you want some more info, or to post some code, just say so.
I want to, besides WASD movement keys, and Space bar for jumping and similar, to use a mouse in my game. So that, once I click the left mouse button it does something... for now, just the animation (or the sprite). And the same for the right mouse click as well.
But how to do it, so that if I am facing right (or moving to the right), once I click the left mouse button I get the animation facing right, and again, vice versa for the left side.
If you want some more info, or to post some code, just say so.