diff options
Diffstat (limited to 'src/doc/feature/script.dox')
-rw-r--r-- | src/doc/feature/script.dox | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/doc/feature/script.dox b/src/doc/feature/script.dox index e3b5508..162b0f5 100644 --- a/src/doc/feature/script.dox +++ b/src/doc/feature/script.dox @@ -21,10 +21,10 @@ BehaviorScript \ref Component "component". \"\ref feature_gameobject\" first. First, define a class (anywhere) that inherits from Script. The Script class -acts as an interface, and has two functions (\ref Script::init "\c init()" and -\ref Script::update "\c update()"), which *may* be implemented (they are empty -by default). From now on, this derivative class will be referred to as a -*concrete script*. +acts as an interface, and has three functions (\ref Script::init "\c init()", +\ref Script::fixed_update "\c fixed_update()" and \ref Script::frame_update +"\c frame_update()"), which *may* be implemented (they are empty by default). +From now on, this derivative class will be referred to as a *concrete script*. ```cpp #include <crepe/api/Script.h> @@ -34,9 +34,13 @@ class MyScript : public crepe::Script { void init() { // called once } - void update() { + + void fixed_update(crepe::duration_t delta_time) { // called on fixed update } + void frame_update(crepe::duration_t delta_time) { + // called for every rendered frame + } }; ``` |