User Tools

Site Tools


al:nerve

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

al:nerve [2022/05/16 10:46] – created fruityloopsal:nerve [2024/02/20 18:02] (current) fruityloops
Line 1: Line 1:
 ====== 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.
al/nerve.1652697993.txt.gz · Last modified: 2022/05/16 10:46 by fruityloops