From 4effe126d5b04d7e8572f8d785735a66150aa4ee Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 24 Feb 2021 21:30:59 -0500 Subject: Ionia is in the water! --- res/maps/hallucination_hot_spring.tmx | 13 ++++++++++++- src/game.cpp | 3 +++ src/map.cpp | 2 ++ src/map.h | 1 + 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/res/maps/hallucination_hot_spring.tmx b/res/maps/hallucination_hot_spring.tmx index 7de1c87..60b25d2 100644 --- a/res/maps/hallucination_hot_spring.tmx +++ b/res/maps/hallucination_hot_spring.tmx @@ -1,5 +1,5 @@ - + @@ -30,6 +30,17 @@ + + + + + + + + + + + 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) { if (!p.animationFilename.empty()) { getSystem().initSprite(spriteId, p.animationFilename); getSprite(spriteId).normallyHasShadow = p.shadow; + if (!p.animName.empty()) { + getSystem().setSpriteAnimation(spriteId, p.animName); + } } getSprite(spriteId).interactionScript = p.interactionScript; 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) { p.collisionSize.h() = property.getIntValue(); } else if (property.getName() == "animation") { p.animationFilename = property.getStringValue(); + } else if (property.getName() == "animName") { + p.animName = 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 1a88cc8..9f5a93b 100644 --- a/src/map.h +++ b/src/map.h @@ -24,6 +24,7 @@ struct Prototype { vec2i collisionOffset; vec2i collisionSize; std::string animationFilename; + std::string animName; std::string interactionScript; bool shadow = false; bool wander = false; -- cgit 1.4.1