Begin documentation on distortion world events#992
Open
Conversation
This continues documentation of the distortion world overlay by beginning the documentation of the event system. An event is defined as a trigger, which is compared against the player position; a flag condition, which allows conditional triggering of events; and a list of commands, which is the actual logic of an event. There can be at most only one running event at a time. While an event is running, player input is (always?) blocked. An event is associated with one or multiple event commands. An event command is a bit of logic that does some operation (spawn a map object, move a platform...). Event commands are simple state machines, with one handler function per state. Event commands can optionally be passed a struct of parameters, to easily reuse a command in multiple events. This first pass focuses on the general event management logic, by documenting functions related to detecting whether the player moved to an event trigger, and running the current event's command handler. This also includes the preliminary work of identifying the static data associated with the events present in each distortion world map. Signed-off-by: Kuruyia <github@kuruyia.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This continues documentation of the distortion world overlay by beginning the documentation of the event system.
An event is defined as a trigger, which is compared against the player position; a flag condition, which allows conditional triggering of events; and a list of commands, which is the actual logic of an event. There can be at most only one running event at a time. While an event is running, player input is (always?) blocked.
An event is associated with one or multiple event commands. An event command is a bit of logic that does some operation (spawn a map object, move a platform...). Event commands are simple state machines, with one handler function per state. Event commands can optionally be passed a struct of parameters, to easily reuse a command in multiple events.
This first pass focuses on the general event management logic, by documenting functions related to detecting whether the player moved to an event trigger, and running the current event's command handler.
This also includes the preliminary work of identifying the static data associated with the events present in each distortion world map.