Buzzles / JBookman_Conversion

JBookman_Conversion
1 stars 0 forks source link

On state.Update, allow states to trigger a transition to a new state #7

Open Buzzles opened 7 years ago

Buzzles commented 7 years ago

Currently the only way to trigger state transition is via keyboard input.

Gamestates should be able to tell the state manager to transition to a new state by returning a process action.

Buzzles commented 7 years ago

Consider moving the state handler to look in a higher level queue for state changes to process, rather than having a processAction returned by the game states.

Would need to figure out how to decouple this at a lower level, maybe use a static factory that checks for an initialised instance of the queue. Can be added to in the game states or input handlers if they need to trigger a state change.

Buzzles commented 7 years ago

Static Queue implemented and tested.

Testing event driven state change too