diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-27 17:40:26 -0500 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-27 17:40:26 -0500 |
| commit | e03683852cac9b31ca846fcf13ff53abf99232c7 (patch) | |
| tree | 4f18e4f6d033547f8bf9210ff8466406ed6dbd49 /src/script_system.cpp | |
| parent | 4be70b7d55493cdc2d5e909d5101e70a16bee6f1 (diff) | |
| download | tanetane-e03683852cac9b31ca846fcf13ff53abf99232c7.tar.gz tanetane-e03683852cac9b31ca846fcf13ff53abf99232c7.tar.bz2 tanetane-e03683852cac9b31ca846fcf13ff53abf99232c7.zip | |
Added A* pathfinding
Diffstat (limited to 'src/script_system.cpp')
| -rw-r--r-- | src/script_system.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
| 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 @@ | |||
| 7 | #include "transform_system.h" | 7 | #include "transform_system.h" |
| 8 | #include "effect_system.h" | 8 | #include "effect_system.h" |
| 9 | #include "camera_system.h" | 9 | #include "camera_system.h" |
| 10 | #include "behaviour_system.h" | ||
| 10 | #include "vector.h" | 11 | #include "vector.h" |
| 11 | 12 | ||
| 12 | ScriptSystem::ScriptSystem(Game& game) : game_(game) { | 13 | ScriptSystem::ScriptSystem(Game& game) : game_(game) { |
| @@ -42,7 +43,8 @@ ScriptSystem::ScriptSystem(Game& game) : game_(game) { | |||
| 42 | "clipping", &Sprite::clipping, | 43 | "clipping", &Sprite::clipping, |
| 43 | "cantCrouch", &Sprite::cantCrouch, | 44 | "cantCrouch", &Sprite::cantCrouch, |
| 44 | "bobsWhenNormal", &Sprite::bobsWhenNormal, | 45 | "bobsWhenNormal", &Sprite::bobsWhenNormal, |
| 45 | "animSlowdown", &Sprite::animSlowdown); | 46 | "animSlowdown", &Sprite::animSlowdown, |
| 47 | "enclosureZone", &Sprite::enclosureZone); | ||
| 46 | 48 | ||
| 47 | engine_.new_usertype<MessageSystem>( | 49 | engine_.new_usertype<MessageSystem>( |
| 48 | "message", | 50 | "message", |
| @@ -93,6 +95,11 @@ ScriptSystem::ScriptSystem(Game& game) : game_(game) { | |||
| 93 | "unlockCamera", &CameraSystem::unlockCamera, | 95 | "unlockCamera", &CameraSystem::unlockCamera, |
| 94 | "setFollowingSprite", &CameraSystem::setFollowingSprite); | 96 | "setFollowingSprite", &CameraSystem::setFollowingSprite); |
| 95 | 97 | ||
| 98 | engine_.new_usertype<BehaviourSystem>( | ||
| 99 | "behaviour", | ||
| 100 | "directSpriteToLocation", &BehaviourSystem::directSpriteToLocation, | ||
| 101 | "isFollowingPath", &BehaviourSystem::isFollowingPath); | ||
| 102 | |||
| 96 | engine_.new_usertype<Mixer>( | 103 | engine_.new_usertype<Mixer>( |
| 97 | "mixer", | 104 | "mixer", |
| 98 | "playSound", &Mixer::playSound, | 105 | "playSound", &Mixer::playSound, |
| @@ -146,6 +153,12 @@ ScriptSystem::ScriptSystem(Game& game) : game_(game) { | |||
| 146 | }); | 153 | }); |
| 147 | 154 | ||
| 148 | engine_.set_function( | 155 | engine_.set_function( |
| 156 | "behaviour", | ||
| 157 | [&] () -> BehaviourSystem& { | ||
| 158 | return game_.getSystem<BehaviourSystem>(); | ||
| 159 | }); | ||
| 160 | |||
| 161 | engine_.set_function( | ||
| 149 | "mixer", | 162 | "mixer", |
| 150 | [&] () -> Mixer& { | 163 | [&] () -> Mixer& { |
| 151 | return game_.getMixer(); | 164 | return game_.getMixer(); |
