summary refs log tree commit diff stats
path: root/src/systems/automating.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2018-05-10 19:27:59 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2018-05-17 15:39:39 -0400
commit4bbfeae42a1245b1b84e8847787d7643e6a6f2cf (patch)
tree8dd65d9ab0cfffd0e79f670c94b035c5eebfa934 /src/systems/automating.h
parent67b24a8ddd89371cfb944c5b441c852f0edc23b1 (diff)
downloadtherapy-4bbfeae42a1245b1b84e8847787d7643e6a6f2cf.tar.gz
therapy-4bbfeae42a1245b1b84e8847787d7643e6a6f2cf.tar.bz2
therapy-4bbfeae42a1245b1b84e8847787d7643e6a6f2cf.zip
Started integrating Lua as a scripting engine
Currently moving platforms are able to have their movement controlled by a script rather than by XML, which is probably a better implementation and scales better to other things. The scripts, instead of using the components as state, use the stack as state. In this way, they pretend to be multithreaded. For instance, the moving platform calls moveRight and then moveLeft. Both of those functions internally make calls that say to wait until the next tick. When the AutomatingSystem ticks, it continues execution of all scripts (sequentially, of course) until they ask for the next tick again. This is implemented using coroutines.
Diffstat (limited to 'src/systems/automating.h')
-rw-r--r--src/systems/automating.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/systems/automating.h b/src/systems/automating.h index c78b7cf..117b622 100644 --- a/src/systems/automating.h +++ b/src/systems/automating.h
@@ -2,6 +2,7 @@
2#define AUTOMATING_H_E6E5D76E 2#define AUTOMATING_H_E6E5D76E
3 3
4#include "system.h" 4#include "system.h"
5#include <sol.hpp>
5 6
6class AutomatingSystem : public System { 7class AutomatingSystem : public System {
7public: 8public:
@@ -14,6 +15,8 @@ public:
14 15
15 void initPrototype(id_type prototype); 16 void initPrototype(id_type prototype);
16 17
18 void initScriptEngine(sol::state& scriptEngine);
19
17}; 20};
18 21
19#endif /* end of include guard: AUTOMATING_H_E6E5D76E */ 22#endif /* end of include guard: AUTOMATING_H_E6E5D76E */