From e03683852cac9b31ca846fcf13ff53abf99232c7 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 27 Feb 2021 17:40:26 -0500 Subject: Added A* pathfinding --- src/script_system.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/script_system.cpp') diff --git a/src/script_system.cpp b/src/script_system.cpp index 7f9f908..931759d 100644 --- a/src/script_system.cpp +++ b/src/script_system.cpp @@ -7,6 +7,7 @@ #include "transform_system.h" #include "effect_system.h" #include "camera_system.h" +#include "behaviour_system.h" #include "vector.h" ScriptSystem::ScriptSystem(Game& game) : game_(game) { @@ -42,7 +43,8 @@ ScriptSystem::ScriptSystem(Game& game) : game_(game) { "clipping", &Sprite::clipping, "cantCrouch", &Sprite::cantCrouch, "bobsWhenNormal", &Sprite::bobsWhenNormal, - "animSlowdown", &Sprite::animSlowdown); + "animSlowdown", &Sprite::animSlowdown, + "enclosureZone", &Sprite::enclosureZone); engine_.new_usertype( "message", @@ -93,6 +95,11 @@ ScriptSystem::ScriptSystem(Game& game) : game_(game) { "unlockCamera", &CameraSystem::unlockCamera, "setFollowingSprite", &CameraSystem::setFollowingSprite); + engine_.new_usertype( + "behaviour", + "directSpriteToLocation", &BehaviourSystem::directSpriteToLocation, + "isFollowingPath", &BehaviourSystem::isFollowingPath); + engine_.new_usertype( "mixer", "playSound", &Mixer::playSound, @@ -145,6 +152,12 @@ ScriptSystem::ScriptSystem(Game& game) : game_(game) { return game_.getSystem(); }); + engine_.set_function( + "behaviour", + [&] () -> BehaviourSystem& { + return game_.getSystem(); + }); + engine_.set_function( "mixer", [&] () -> Mixer& { -- cgit 1.4.1