summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game.cpp3
-rw-r--r--src/map.cpp2
-rw-r--r--src/map.h1
3 files changed, 6 insertions, 0 deletions
diff --git a/src/game.cpp b/src/game.cpp index 2a4308f..af66068 100644 --- a/src/game.cpp +++ b/src/game.cpp
@@ -60,6 +60,9 @@ void Game::loadMap(std::string filename) {
60 if (!p.animationFilename.empty()) { 60 if (!p.animationFilename.empty()) {
61 getSystem<AnimationSystem>().initSprite(spriteId, p.animationFilename); 61 getSystem<AnimationSystem>().initSprite(spriteId, p.animationFilename);
62 getSprite(spriteId).normallyHasShadow = p.shadow; 62 getSprite(spriteId).normallyHasShadow = p.shadow;
63 if (!p.animName.empty()) {
64 getSystem<AnimationSystem>().setSpriteAnimation(spriteId, p.animName);
65 }
63 } 66 }
64 getSprite(spriteId).interactionScript = p.interactionScript; 67 getSprite(spriteId).interactionScript = p.interactionScript;
65 if (p.movementSpeed != -1) { 68 if (p.movementSpeed != -1) {
diff --git a/src/map.cpp b/src/map.cpp index 23445e4..a5ecbdd 100644 --- a/src/map.cpp +++ b/src/map.cpp
@@ -89,6 +89,8 @@ Map::Map(std::string_view name) : name_(name) {
89 p.collisionSize.h() = property.getIntValue(); 89 p.collisionSize.h() = property.getIntValue();
90 } else if (property.getName() == "animation") { 90 } else if (property.getName() == "animation") {
91 p.animationFilename = property.getStringValue(); 91 p.animationFilename = property.getStringValue();
92 } else if (property.getName() == "animName") {
93 p.animName = property.getStringValue();
92 } else if (property.getName() == "interactionScript") { 94 } else if (property.getName() == "interactionScript") {
93 p.interactionScript = property.getStringValue(); 95 p.interactionScript = property.getStringValue();
94 } else if (property.getName() == "shadow") { 96 } else if (property.getName() == "shadow") {
diff --git a/src/map.h b/src/map.h index 1a88cc8..9f5a93b 100644 --- a/src/map.h +++ b/src/map.h
@@ -24,6 +24,7 @@ struct Prototype {
24 vec2i collisionOffset; 24 vec2i collisionOffset;
25 vec2i collisionSize; 25 vec2i collisionSize;
26 std::string animationFilename; 26 std::string animationFilename;
27 std::string animName;
27 std::string interactionScript; 28 std::string interactionScript;
28 bool shadow = false; 29 bool shadow = false;
29 bool wander = false; 30 bool wander = false;