RPG game engine production - state machine

xiaoxiao2021-03-06  21

As mentioned earlier, the UI switching of the game is driven by a state machine, so it is discussed here.

Main features: Status is mainly indicated by the game system to respond to the user. Different in different states, draw, and event handles are different. In fact, it is equivalent to Windows programming windows. The state machine provides switching between states. This switchback is designed to switch to the specified state, but the maximum is used to return to the previous state. There is also a specific task in a certain state, switching to a state, and in this state, there is a switch between the state, but after completing the task, return to the status of the previous initiating task. So there is a need to save and extract.

Modules that need to be implemented:

1 State constant set: Different states are indicated by a state constant;

2 Recently experienced status list: This list is mainly to return the last interface, because this is mainly for processful things, so the status order here is related to your process, and the recommended stack is implemented.

3 Save the status list: You may implement multiple status save points, but when I realize the previous game, I only use one, which is the script control state. This state is the lifeline of the RPG requires constant switching.

When the function of this state machine is introduced, it will not be mentioned here, because the implementation is different from person to person.

转载请注明原文地址:https://www.9cbs.com/read-39770.html

New Post(0)