PyroFlareX / Zymon

Pokemon clone. Inspired by OpMon. Wanted to try it myself to see a different way of doing things.
MIT License
3 stars 0 forks source link

State pushing Issue #10

Closed PyroFlareX closed 5 years ago

PyroFlareX commented 5 years ago

A State is pushed in application constructor. When I try to push a state (state 1) from within a state (state 2)(either BattleState or GameState) the error occurs. If I push the same state, no error, but it is obviously useless pushing the same state.

If State 1 pushes State 2 or vice versa, error. If State 1 or 2 pushes itself, no error.

PyroFlareX commented 5 years ago

Possible fix: Add bool returning function to states that is checked in the loop, or possibly by another thread. This isn't preferable IMO, but it would help with changes in state.

PyroFlareX commented 5 years ago

Fixed, went with passing a reference to the Application class in the input function, still should be worked on a bit though.