summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game.cpp1
-rw-r--r--src/map.cpp2
-rw-r--r--src/map.h1
3 files changed, 4 insertions, 0 deletions
diff --git a/src/game.cpp b/src/game.cpp index 8ba4c85..5b5c506 100644 --- a/src/game.cpp +++ b/src/game.cpp
@@ -64,6 +64,7 @@ void Game::loadMap(std::string filename) {
64 if (!p.animName.empty()) { 64 if (!p.animName.empty()) {
65 getSystem<AnimationSystem>().setSpriteAnimation(spriteId, p.animName); 65 getSystem<AnimationSystem>().setSpriteAnimation(spriteId, p.animName);
66 } 66 }
67 getSystem<AnimationSystem>().setSpriteDirection(spriteId, p.dir);
67 } 68 }
68 getSprite(spriteId).interactionScript = p.interactionScript; 69 getSprite(spriteId).interactionScript = p.interactionScript;
69 if (p.movementSpeed != -1) { 70 if (p.movementSpeed != -1) {
diff --git a/src/map.cpp b/src/map.cpp index 0cf9402..c3ac828 100644 --- a/src/map.cpp +++ b/src/map.cpp
@@ -91,6 +91,8 @@ Map::Map(std::string_view name) : name_(name) {
91 p.animationFilename = "../res/sprites/" + property.getStringValue() + "_anim.txt"; 91 p.animationFilename = "../res/sprites/" + property.getStringValue() + "_anim.txt";
92 } else if (property.getName() == "animName") { 92 } else if (property.getName() == "animName") {
93 p.animName = property.getStringValue(); 93 p.animName = property.getStringValue();
94 } else if (property.getName() == "direction") {
95 p.dir = directionFromString(property.getStringValue());
94 } else if (property.getName() == "interactionScript") { 96 } else if (property.getName() == "interactionScript") {
95 p.interactionScript = property.getStringValue(); 97 p.interactionScript = property.getStringValue();
96 } else if (property.getName() == "shadow") { 98 } else if (property.getName() == "shadow") {
diff --git a/src/map.h b/src/map.h index ee88920..80a79b0 100644 --- a/src/map.h +++ b/src/map.h
@@ -25,6 +25,7 @@ struct Prototype {
25 vec2i collisionSize; 25 vec2i collisionSize;
26 std::string animationFilename; 26 std::string animationFilename;
27 std::string animName; 27 std::string animName;
28 Direction dir = Direction::down;
28 std::string interactionScript; 29 std::string interactionScript;
29 bool shadow = false; 30 bool shadow = false;
30 bool wander = false; 31 bool wander = false;