Differences
This shows you the differences between two versions of the page.
| |
al:nerve [2022/05/16 10:46] – created fruityloops | al:nerve [2024/02/20 18:02] (current) – fruityloops |
---|
====== al::Nerve ====== | ====== al::Nerve ====== |
"Nerves" are a concept al uses to simplify distributing code in per-frame update functions. While this increases the amount of boilerplate code in the project, it makes code easier to read and understand. | "Nerves" are a concept (State Machine in which every "Nerve" acts as a State) al uses to simplify distributing code in per-frame update functions. While this increases the amount of boilerplate code in the project, it makes code easier to read and understand. |
| |
Any class can inherit from the IUseNerve interface to provide a NerveKeeper. The NerveKeeper holds the current active nerve, and how many frames it has been running for. A "Nerve" is a member function of the class that will run every frame if it is active. For actors, nerves are often directly linked to skeletal animations the actor has, for example a "Jump" nerve that plays the "Jump" animation. | Any class can inherit from the IUseNerve interface to provide a NerveKeeper. The NerveKeeper holds the current active nerve, and how many frames it has been running for. A "Nerve" is a member function of the class that will run every frame if it is active. For actors, nerves are often directly linked to skeletal animations the actor has, for example a "Jump" nerve that plays the "Jump" animation. |