From 14c3e64dc08ce1bcd8f2e421150f3f8e88de914a Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Mon, 1 Mar 2021 17:59:34 -0500 Subject: Added (human) Mixolydia sprite --- src/game.cpp | 1 + src/map.cpp | 2 ++ src/map.h | 1 + 3 files changed, 4 insertions(+) (limited to 'src') 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) { if (!p.animName.empty()) { getSystem().setSpriteAnimation(spriteId, p.animName); } + getSystem().setSpriteDirection(spriteId, p.dir); } getSprite(spriteId).interactionScript = p.interactionScript; 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) { p.animationFilename = "../res/sprites/" + property.getStringValue() + "_anim.txt"; } else if (property.getName() == "animName") { p.animName = property.getStringValue(); + } else if (property.getName() == "direction") { + p.dir = directionFromString(property.getStringValue()); } else if (property.getName() == "interactionScript") { p.interactionScript = property.getStringValue(); } 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 { vec2i collisionSize; std::string animationFilename; std::string animName; + Direction dir = Direction::down; std::string interactionScript; bool shadow = false; bool wander = false; -- cgit 1.4.1