From 43297e2752138a881f33447864e6025648ea5557 Mon Sep 17 00:00:00 2001 From: Antoine Pilote Date: Sun, 13 Jun 2021 18:27:41 -0400 Subject: [PATCH] added entity script example --- docs/Scripting/entity_scripts.rst | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/docs/Scripting/entity_scripts.rst b/docs/Scripting/entity_scripts.rst index 70493696..e034648c 100644 --- a/docs/Scripting/entity_scripts.rst +++ b/docs/Scripting/entity_scripts.rst @@ -1,2 +1,31 @@ Entity scripts -============== \ No newline at end of file +============== + +Entity scripts are Wren scripts that are attached to an entity using the WrenScript component. + +After attaching the WrenScript component on an entity, you can select the script file directly. +In addition to pointing to the script file, you need to specify which class in the script is considered as the +entity script. + +The class chosen must inherite from ScriptableEntity. + +Here is an example of a barebone entity scripts:: + + import "Scripts/ScriptableEntity" for ScriptableEntity + + class TestScript is ScriptableEntity { + construct new() { + } + + init() { + + } + + update(ts) { + + } + + exit() { + + } + } \ No newline at end of file