Hi,
I'm having trouble implementing an enum state machine within the gamestate class of my game here.
Before anyone goes ripping my head off, the reason why I'm nesting a state machine into the gamestate is so that I can handle turns (phases) within my game loop without having to create new state classes in slick.
I'm trying to implement the enums in such a way that they act as switches - only allowing certain code to run depending on the state of the machine - so far I think the only way to do this is to have a turnstate enum and a turn handler class and then implement the "switches" as objects within the update section of the game. However this is really not working out for me.
In my frustration I actually deleted my code so I have nothing to post - has anyone managed this and if so, could you post me an example to work from?
Relaxis
|