Background info
Since a few days im working on a multiplayer 2d rpg Based on Java/libgdx. Today i Tried to add some Animations to my Player, that worked for the Idle Animation. But and heres my questions how do i do this for more than once? I am using png spritesheets for the Different states like Idle, Walking etc. I Used states in my Player class like Idle/Walking right/left. In my Animation class There states too, the Same But i cant compare them because they Are enums.
**Main Question **
Is There an easy way to compare and set the enums states out of
class Player {
public enum Animationstates{
IDLE,RIGHT,LEFT
}
Animationstates Currentstate;
public AnimationState GetStatefromplayer(){
return Currentstate;
}
}
With
class Animatedsprite{
public enum AnimationStates{
IDLE,RIGHT,LEFT
}
AnimationState Currentstate = AnimationState.IDLE;
public void setState (AnimationState state){
Currentstate = state;
}
}
I Tried a few Different things like :
Animatedsprite.setState(Player.getState());
But that didnt worked :/ any solutions?