summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--res/maps/hallucination_hot_spring.tmx13
-rw-r--r--src/game.cpp3
-rw-r--r--src/map.cpp2
-rw-r--r--src/map.h1
4 files changed, 18 insertions, 1 deletions
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 @@
1<?xml version="1.0" encoding="UTF-8"?> 1<?xml version="1.0" encoding="UTF-8"?>
2<map version="1.4" tiledversion="1.4.3" orientation="orthogonal" renderorder="right-down" width="32" height="16" tilewidth="16" tileheight="16" infinite="0" nextlayerid="3" nextobjectid="3"> 2<map version="1.4" tiledversion="1.4.3" orientation="orthogonal" renderorder="right-down" width="32" height="16" tilewidth="16" tileheight="16" infinite="0" nextlayerid="3" nextobjectid="4">
3 <tileset firstgid="1" source="hallucination.tsx"/> 3 <tileset firstgid="1" source="hallucination.tsx"/>
4 <layer id="2" name="Lower" width="32" height="16"> 4 <layer id="2" name="Lower" width="32" height="16">
5 <data encoding="csv"> 5 <data encoding="csv">
@@ -30,6 +30,17 @@
30 <property name="script" value="off_right"/> 30 <property name="script" value="off_right"/>
31 </properties> 31 </properties>
32 </object> 32 </object>
33 <object id="3" name="water_ionia" type="sprite" x="312" y="104.5">
34 <properties>
35 <property name="animName" value="swim_still"/>
36 <property name="animation" value="../res/sprites/ionia_anim.txt"/>
37 <property name="collisionHeight" type="int" value="8"/>
38 <property name="collisionOffsetX" type="int" value="-8"/>
39 <property name="collisionOffsetY" type="int" value="-8"/>
40 <property name="collisionWidth" type="int" value="12"/>
41 </properties>
42 <point/>
43 </object>
33 </objectgroup> 44 </objectgroup>
34 <layer id="1" name="Upper (most)" width="32" height="16"> 45 <layer id="1" name="Upper (most)" width="32" height="16">
35 <properties> 46 <properties>
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;