From 89fc2da3f08fcd751ca069fde0987d193e59b007 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Tue, 9 Mar 2021 11:51:34 -0500 Subject: Added "let's switch places!" Claus sprite He will wander randomly until you get close, and will then run at you. Talking to him or bumping into him does nothing currently. If you move out of his range of interest he will go back to wandering at a walking pace. #10 --- src/script_system.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/script_system.cpp') diff --git a/src/script_system.cpp b/src/script_system.cpp index 50ea60a..a50fa7a 100644 --- a/src/script_system.cpp +++ b/src/script_system.cpp @@ -52,7 +52,8 @@ ScriptSystem::ScriptSystem(Game& game) : game_(game) { "enclosureZone", &Sprite::enclosureZone, "movementSpeed", &Sprite::movementSpeed, "solid", &Sprite::solid, - "behaviourType", &Sprite::behaviourType); + "behaviourType", &Sprite::behaviourType, + "followSpriteId", &Sprite::followSpriteId); engine_.new_usertype( "message", @@ -242,6 +243,7 @@ ScriptSystem::ScriptSystem(Game& game) : game_(game) { loadMapScripts(filename); }); + engine_.set_function("directionFacingPoint", &directionFacingPoint); engine_.set_function("cardinalDirectionFacingPoint", &cardinalDirectionFacingPoint); engine_.script_file("../res/scripts/common.lua"); -- cgit 1.4.1