Sounds like you're looking at implementing a Finite State Machine. Learning about what that is would be a good place to start.
Sounds like you're looking at implementing a Finite State Machine. Learning about what that is would be a good place to start.