04-06-2020, 07:53 AM
Welcome! Glad to help :-)
Traditional approach is to encapsulate state variables inside a game entity or actor, an abstraction of everything that exists inside a game.
I don't know what's going wrong with multiple animations, but I suspect that you only check the walk state variable, whereas now you should check that when dir changes state, you must update animation too. If not, direction change is ignored until walk transitions to another state.
Traditional approach is to encapsulate state variables inside a game entity or actor, an abstraction of everything that exists inside a game.
I don't know what's going wrong with multiple animations, but I suspect that you only check the walk state variable, whereas now you should check that when dir changes state, you must update animation too. If not, direction change is ignored until walk transitions to another state.