summary refs log tree commit diff stats
path: root/src/map.h
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2021-07-05 11:58:29 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2021-07-05 11:58:29 -0400
commit324346a87c114f0991a092ac8653afecada364b5 (patch)
treef88ac730897056918b366e7fabaad2b136383d59 /src/map.h
parentd983ef6b8d66d916ed7502cf6d35b573c5366257 (diff)
downloadtanetane-324346a87c114f0991a092ac8653afecada364b5.tar.gz
tanetane-324346a87c114f0991a092ac8653afecada364b5.tar.bz2
tanetane-324346a87c114f0991a092ac8653afecada364b5.zip
Added background scripts
Background scripts are scripts that are launched when a map is loaded. They differ in use from a map's init script in that they are expected to contain an infinite loop. These scripts are linked to a sprite and will be killed when that sprite is destroyed (usually when the map is unloaded, but if the sprite is made persistent then it may last longer). The thread running the script is given no warning that it is being killed; the coroutine is simply never called again, and the thread is disposed of. Because of this, background scripts MUST ensure the game is in a consistent state before coroutine yielding, because it is not guaranteed that the coroutine will ever be called again.
Diffstat (limited to 'src/map.h')
-rw-r--r--src/map.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/map.h b/src/map.h index 7300e76..48c0223 100644 --- a/src/map.h +++ b/src/map.h
@@ -28,6 +28,7 @@ struct Prototype {
28 Direction dir = Direction::down; 28 Direction dir = Direction::down;
29 std::string interactionScript; 29 std::string interactionScript;
30 std::string bumpPlayerScript; 30 std::string bumpPlayerScript;
31 std::string backgroundScript;
31 bool shadow = false; 32 bool shadow = false;
32 bool wander = false; 33 bool wander = false;
33 int movementSpeed = -1; 34 int movementSpeed = -1;