summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2021-02-17 15:11:37 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2021-02-17 15:11:37 -0500
commitb3720c4a401f345c49eadabdb852968e273e7077 (patch)
tree79f6e3172c6b847a705157e698648e4a8a2da4b5 /src
parenta645524d19bb9183d4eece72bf8945bba4bed3a0 (diff)
downloadtanetane-b3720c4a401f345c49eadabdb852968e273e7077.tar.gz
tanetane-b3720c4a401f345c49eadabdb852968e273e7077.tar.bz2
tanetane-b3720c4a401f345c49eadabdb852968e273e7077.zip
Added expressions (currently just surprise)
Diffstat (limited to 'src')
-rw-r--r--src/script_system.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/script_system.cpp b/src/script_system.cpp index 3ac04ac..8674f97 100644 --- a/src/script_system.cpp +++ b/src/script_system.cpp
@@ -20,6 +20,11 @@ ScriptSystem::ScriptSystem(Game& game) : game_(game) {
20 "x", [] (const vec2i& v) { return v.x(); }, 20 "x", [] (const vec2i& v) { return v.x(); },
21 "y", [] (const vec2i& v) { return v.y(); }); 21 "y", [] (const vec2i& v) { return v.y(); });
22 22
23 engine_.new_usertype<SpriteFrame>(
24 "spriteframe",
25 "center", &SpriteFrame::center,
26 "size", &SpriteFrame::size);
27
23 engine_.new_usertype<Sprite>( 28 engine_.new_usertype<Sprite>(
24 "sprite", 29 "sprite",
25 "loc", &Sprite::loc, 30 "loc", &Sprite::loc,
@@ -27,7 +32,10 @@ ScriptSystem::ScriptSystem(Game& game) : game_(game) {
27 "followers", &Sprite::followers, 32 "followers", &Sprite::followers,
28 "characterState", &Sprite::characterState, 33 "characterState", &Sprite::characterState,
29 "controllable", &Sprite::controllable, 34 "controllable", &Sprite::controllable,
30 "animFinished", &Sprite::animFinished); 35 "animFinished", &Sprite::animFinished,
36 "getCurrentFrame", [] (const Sprite& sprite) -> const SpriteFrame& {
37 return sprite.frames[sprite.animations[sprite.animationId].frameIndices[sprite.animationFrame]];
38 });
31 39
32 engine_.new_usertype<MessageSystem>( 40 engine_.new_usertype<MessageSystem>(
33 "message", 41 "message",