summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2021-02-24 17:50:06 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2021-02-24 17:50:06 -0500
commit7747a943b1831eca1be213610a729f8071ebd5d7 (patch)
treeb6265f43be9b9c21bba92d855d870630d7df5c40
parenta3585e9928f290465e514f0eef3baa147679f075 (diff)
downloadtanetane-7747a943b1831eca1be213610a729f8071ebd5d7.tar.gz
tanetane-7747a943b1831eca1be213610a729f8071ebd5d7.tar.bz2
tanetane-7747a943b1831eca1be213610a729f8071ebd5d7.zip
Added animation for being in a hot spring
-rw-r--r--res/maps/hallucination.tsx30
-rw-r--r--res/sprites/boney.pngbin77904 -> 79614 bytes
-rw-r--r--res/sprites/boney_anim.txt18
-rw-r--r--res/sprites/boney_frames.txt10
-rw-r--r--res/sprites/duster.pngbin97607 -> 99956 bytes
-rw-r--r--res/sprites/duster_anim.txt18
-rw-r--r--res/sprites/duster_frames.txt18
-rw-r--r--res/sprites/kuma_anim.txt18
-rw-r--r--res/sprites/kumatora.pngbin67143 -> 68906 bytes
-rw-r--r--res/sprites/kumatora_frames.txt18
-rw-r--r--res/sprites/lucas.pngbin90846 -> 96860 bytes
-rw-r--r--res/sprites/lucas_anim.txt18
-rw-r--r--res/sprites/lucas_frames.txt37
-rw-r--r--src/character_system.cpp23
-rw-r--r--src/map.cpp2
-rw-r--r--src/sprite.h3
16 files changed, 202 insertions, 11 deletions
diff --git a/res/maps/hallucination.tsx b/res/maps/hallucination.tsx index 6317866..130bc9c 100644 --- a/res/maps/hallucination.tsx +++ b/res/maps/hallucination.tsx
@@ -1557,6 +1557,16 @@
1557 <property name="solid" type="bool" value="true"/> 1557 <property name="solid" type="bool" value="true"/>
1558 </properties> 1558 </properties>
1559 </tile> 1559 </tile>
1560 <tile id="439">
1561 <properties>
1562 <property name="medium" value="water"/>
1563 </properties>
1564 </tile>
1565 <tile id="440">
1566 <properties>
1567 <property name="solid" type="bool" value="true"/>
1568 </properties>
1569 </tile>
1560 <tile id="441"> 1570 <tile id="441">
1561 <properties> 1571 <properties>
1562 <property name="solid" type="bool" value="true"/> 1572 <property name="solid" type="bool" value="true"/>
@@ -1572,6 +1582,21 @@
1572 <property name="solid" type="bool" value="true"/> 1582 <property name="solid" type="bool" value="true"/>
1573 </properties> 1583 </properties>
1574 </tile> 1584 </tile>
1585 <tile id="444">
1586 <properties>
1587 <property name="medium" value="water"/>
1588 </properties>
1589 </tile>
1590 <tile id="445">
1591 <properties>
1592 <property name="medium" value="water"/>
1593 </properties>
1594 </tile>
1595 <tile id="446">
1596 <properties>
1597 <property name="medium" value="water"/>
1598 </properties>
1599 </tile>
1575 <tile id="447"> 1600 <tile id="447">
1576 <properties> 1601 <properties>
1577 <property name="solid" type="bool" value="true"/> 1602 <property name="solid" type="bool" value="true"/>
@@ -1587,6 +1612,11 @@
1587 <property name="solid" type="bool" value="true"/> 1612 <property name="solid" type="bool" value="true"/>
1588 </properties> 1613 </properties>
1589 </tile> 1614 </tile>
1615 <tile id="450">
1616 <properties>
1617 <property name="medium" value="water"/>
1618 </properties>
1619 </tile>
1590 <tile id="451"> 1620 <tile id="451">
1591 <properties> 1621 <properties>
1592 <property name="solid" type="bool" value="true"/> 1622 <property name="solid" type="bool" value="true"/>
diff --git a/res/sprites/boney.png b/res/sprites/boney.png index 9c699ad..4c98d3c 100644 --- a/res/sprites/boney.png +++ b/res/sprites/boney.png
Binary files differ
diff --git a/res/sprites/boney_anim.txt b/res/sprites/boney_anim.txt index 3c8c139..9066ee0 100644 --- a/res/sprites/boney_anim.txt +++ b/res/sprites/boney_anim.txt
@@ -49,4 +49,20 @@ barking[up_right]: 5,37,45,37,45,37,45
49barking[right]: 6,38,46,38,46,38,46 49barking[right]: 6,38,46,38,46,38,46
50barking[down_right]: 7,39,47,39,47,39,47 50barking[down_right]: 7,39,47,39,47,39,47
51climb[up]%60: 240#5,241#4,242#8,243#2,244#2,245#2,246#2,247#2,248#2,249#2,250#2,251#3,252#3 51climb[up]%60: 240#5,241#4,242#8,243#2,244#2,245#2,246#2,247#2,248#2,249#2,250#2,251#3,252#3
52climb[down]%60: 253#5,254#4,255#8,256#2,257#2,258#2,259#2,260#2,261#2,262#2,263#2,264#3,265#3 \ No newline at end of file 52climb[down]%60: 253#5,254#4,255#8,256#2,257#2,258#2,259#2,260#2,261#2,262#2,263#2,264#3,265#3
53swim_still[down]: 366
54swim_still[down_left]: 367
55swim_still[left]: 368
56swim_still[up_left]: 369
57swim_still[up]: 370
58swim_still[up_right]: 371
59swim_still[right]: 372
60swim_still[down_right]: 373
61swim_walk[down]: 366
62swim_walk[down_left]: 367
63swim_walk[left]: 368
64swim_walk[up_left]: 369
65swim_walk[up]: 370
66swim_walk[up_right]: 371
67swim_walk[right]: 372
68swim_walk[down_right]: 373 \ No newline at end of file
diff --git a/res/sprites/boney_frames.txt b/res/sprites/boney_frames.txt index 786cac5..b950382 100644 --- a/res/sprites/boney_frames.txt +++ b/res/sprites/boney_frames.txt
@@ -1,6 +1,6 @@
132,32 cell size 132,32 cell size
210 frames per row 210 frames per row
3366 frames 3374 frames
4 4
516,24,8,24 516,24,8,24
632,24,16,24 632,24,16,24
@@ -368,3 +368,11 @@
36816,24,8,21 36816,24,8,21
36917,24,9,21 36917,24,9,21
37017,24,8,21 37017,24,8,21
37116,16,8,16
37216,16,9,16
37332,16,16,16
37432,16,16,16
37516,16,8,16
37632,16,16,16
37732,16,16,16
37816,16,7,16
diff --git a/res/sprites/duster.png b/res/sprites/duster.png index 48e8261..5403d5c 100644 --- a/res/sprites/duster.png +++ b/res/sprites/duster.png
Binary files differ
diff --git a/res/sprites/duster_anim.txt b/res/sprites/duster_anim.txt index da5b0fe..45562c0 100644 --- a/res/sprites/duster_anim.txt +++ b/res/sprites/duster_anim.txt
@@ -41,4 +41,20 @@ run[up_right]: 77,85,93,101,109
41run[right]: 78,86,94,102,110 41run[right]: 78,86,94,102,110
42run[down_right]: 79,87,95,103,111 42run[down_right]: 79,87,95,103,111
43climb[up]%60: 200#10,201,202,208#10,207,206,203#10,204,205,208#10,207,206 43climb[up]%60: 200#10,201,202,208#10,207,206,203#10,204,205,208#10,207,206
44climb[down]%60: 200#10,201,202,208#10,207,206,203#10,204,205,208#10,207,206 \ No newline at end of file 44climb[down]%60: 200#10,201,202,208#10,207,206,203#10,204,205,208#10,207,206
45swim_still[down]: 331#57,339,331,339
46swim_still[down_left]: 332#57,332,340,332
47swim_still[left]: 333#57,341,333,341
48swim_still[up_left]: 334
49swim_still[up]: 335
50swim_still[up_right]: 336
51swim_still[right]: 337#57,345,337,345
52swim_still[down_right]: 338#57,346,338,346
53swim_walk[down]: 331
54swim_walk[down_left]: 332
55swim_walk[left]: 333
56swim_walk[up_left]: 334
57swim_walk[up]: 335
58swim_walk[up_right]: 336
59swim_walk[right]: 337
60swim_walk[down_right]: 338 \ No newline at end of file
diff --git a/res/sprites/duster_frames.txt b/res/sprites/duster_frames.txt index 8335bf3..30415b6 100644 --- a/res/sprites/duster_frames.txt +++ b/res/sprites/duster_frames.txt
@@ -1,6 +1,6 @@
140,32 cell size 140,32 cell size
210 frames per row 210 frames per row
3331 frames 3347 frames
4 4
532,32,16,32 532,32,16,32
632,32,16,32 632,32,16,32
@@ -333,3 +333,19 @@
33332,32,16,32 33332,32,16,32
33433,32,17,32 33433,32,17,32
33533,32,16,32 33533,32,16,32
33632,24,16,24
33732,24,16,24
33832,24,16,24
33932,24,16,24
34032,24,16,24
34132,24,16,24
34232,24,16,24
34332,24,16,24
34432,24,16,24
34532,24,16,24
34632,24,16,24
34732,24,16,24
34832,24,16,24
34932,24,16,24
35032,24,16,24
35132,24,16,24
diff --git a/res/sprites/kuma_anim.txt b/res/sprites/kuma_anim.txt index 532a0f0..8ffb634 100644 --- a/res/sprites/kuma_anim.txt +++ b/res/sprites/kuma_anim.txt
@@ -49,4 +49,20 @@ talk[up_right]: 37,45
49talk[right]: 38,46 49talk[right]: 38,46
50talk[down_right]: 39,47 50talk[down_right]: 39,47
51climb[up]%60: 257#10,258,259,265#10,264,263,260#10,261,262,265#10,264,263 51climb[up]%60: 257#10,258,259,265#10,264,263,260#10,261,262,265#10,264,263
52climb[down]%60: 257#10,258,259,265#10,264,263,260#10,261,262,265#10,264,263 \ No newline at end of file 52climb[down]%60: 257#10,258,259,265#10,264,263,260#10,261,262,265#10,264,263
53swim_still[down]: 274#80,282,274,282
54swim_still[down_left]: 275#80,283,275,283
55swim_still[left]: 276#80,284,276,284
56swim_still[up_left]: 277
57swim_still[up]: 278
58swim_still[up_right]: 279
59swim_still[right]: 280#80,288,280,288
60swim_still[down_right]: 281#80,289,281,289
61swim_walk[down]: 274
62swim_walk[down_left]: 275
63swim_walk[left]: 276
64swim_walk[up_left]: 277
65swim_walk[up]: 278
66swim_walk[up_right]: 279
67swim_walk[right]: 280
68swim_walk[down_right]: 281 \ No newline at end of file
diff --git a/res/sprites/kumatora.png b/res/sprites/kumatora.png index 6fe4b26..bc40798 100644 --- a/res/sprites/kumatora.png +++ b/res/sprites/kumatora.png
Binary files differ
diff --git a/res/sprites/kumatora_frames.txt b/res/sprites/kumatora_frames.txt index 14aecc6..7f2a1de 100644 --- a/res/sprites/kumatora_frames.txt +++ b/res/sprites/kumatora_frames.txt
@@ -1,6 +1,6 @@
133,32 cell size 133,32 cell size
210 frames per row 210 frames per row
3274 frames 3290 frames
4 4
532,32,16,32 532,32,16,32
632,32,16,32 632,32,16,32
@@ -276,3 +276,19 @@
27632,32,16,32 27632,32,16,32
27732,32,17,32 27732,32,17,32
27832,32,15,32 27832,32,15,32
27932,16,16,16
28032,16,16,16
28116,16,7,16
28216,16,7,16
28332,16,16,16
28416,16,9,16
28516,16,9,16
28632,16,16,16
28732,16,16,16
28832,16,16,16
28916,16,7,16
29016,16,7,16
29116,16,7,16
29216,16,7,16
29316,16,9,16
29432,16,16,16
diff --git a/res/sprites/lucas.png b/res/sprites/lucas.png index dd053e5..82875d4 100644 --- a/res/sprites/lucas.png +++ b/res/sprites/lucas.png
Binary files differ
diff --git a/res/sprites/lucas_anim.txt b/res/sprites/lucas_anim.txt index f6ed06e..5eb7d91 100644 --- a/res/sprites/lucas_anim.txt +++ b/res/sprites/lucas_anim.txt
@@ -43,4 +43,20 @@ run[down_right]: 74,82,90,98
43lightning_electrocute![down]: 116,117,118,116,117,118 43lightning_electrocute![down]: 116,117,118,116,117,118
44lightning_collapse![down]: 119,120,121,122 44lightning_collapse![down]: 119,120,121,122
45climb[up]%60: 123#10,124,125,128#10,127,126,129#10,130,131,128#10,127,126 45climb[up]%60: 123#10,124,125,128#10,127,126,129#10,130,131,128#10,127,126
46climb[down]%60: 123#10,124,125,128#10,127,126,129#10,130,131,128#10,127,126 \ No newline at end of file 46climb[down]%60: 123#10,124,125,128#10,127,126,129#10,130,131,128#10,127,126
47swim_still[down]: 399#53,407,399,407
48swim_still[down_left]: 400#53,408,400,408
49swim_still[left]: 401#53,409,401,409
50swim_still[up_left]: 402
51swim_still[up]: 403
52swim_still[up_right]: 404
53swim_still[right]: 405#53,413,405,413
54swim_still[down_right]: 406#53,414,406,414
55swim_walk[down]: 399
56swim_walk[down_left]: 400
57swim_walk[left]: 401
58swim_walk[up_left]: 402
59swim_walk[up]: 403
60swim_walk[up_right]: 404
61swim_walk[right]: 405
62swim_walk[down_right]: 406 \ No newline at end of file
diff --git a/res/sprites/lucas_frames.txt b/res/sprites/lucas_frames.txt index e64d1e1..a1bc88f 100644 --- a/res/sprites/lucas_frames.txt +++ b/res/sprites/lucas_frames.txt
@@ -1,6 +1,6 @@
132,64 cell size 132,64 cell size
210 frames per row 210 frames per row
3399 frames 3434 frames
4 4
516,32,8,32 516,32,8,32
616,32,8,32 616,32,8,32
@@ -401,3 +401,38 @@
40116,24,9,25 40116,24,9,25
40216,24,9,24 40216,24,9,24
40316,32,8,32 40316,32,8,32
40416,16,8,15
40516,16,8,15
40616,16,8,15
40716,16,8,15
40816,16,9,15
40916,16,9,15
41016,16,9,15
41116,16,9,15
41216,16,8,15
41316,16,8,15
41416,16,8,15
41516,16,8,15
41616,16,8,15
41716,16,8,15
41816,16,9,15
41916,16,9,15
42032,32,15,23
42132,32,15,23
42232,32,15,23
42316,24,8,23
42416,16,8,15
42516,16,8,15
42616,16,8,15
42716,24,8,15
42816,24,8,15
42916,24,8,15
43016,24,8,15
43116,24,8,15
43216,24,8,15
43316,16,8,15
43432,24,16,23
43532,24,16,23
43632,32,16,23
43732,24,16,15
43832,24,16,15
diff --git a/src/character_system.cpp b/src/character_system.cpp index bc02e6c..bcd3beb 100644 --- a/src/character_system.cpp +++ b/src/character_system.cpp
@@ -75,7 +75,8 @@ void CharacterSystem::moveInDirection(int spriteId, Direction dir) {
75 sprite.movementDir = dir; 75 sprite.movementDir = dir;
76 76
77 switch (sprite.characterMedium) { 77 switch (sprite.characterMedium) {
78 case CharacterMedium::Normal: { 78 case CharacterMedium::Normal:
79 case CharacterMedium::Water: {
79 game_.getSystem<AnimationSystem>().setSpriteDirection(spriteId, dir); 80 game_.getSystem<AnimationSystem>().setSpriteDirection(spriteId, dir);
80 break; 81 break;
81 } 82 }
@@ -171,6 +172,12 @@ void CharacterSystem::tick(double dt) {
171 sprite.characterMedium = newMedium; 172 sprite.characterMedium = newMedium;
172 setAnimationFor(spriteId, sprite.characterState); 173 setAnimationFor(spriteId, sprite.characterState);
173 adjustPartyTrails(spriteId); 174 adjustPartyTrails(spriteId);
175
176 // Stop running if you go into water.
177 if (newMedium == CharacterMedium::Water &&
178 sprite.characterState == CharacterState::Running) {
179 stopRunning(spriteId);
180 }
174 } 181 }
175 182
176 if (sprite.characterState == CharacterState::Running) { 183 if (sprite.characterState == CharacterState::Running) {
@@ -214,7 +221,8 @@ void CharacterSystem::beginCrouch(int spriteId) {
214 if (sprite.characterState == CharacterState::Running) { 221 if (sprite.characterState == CharacterState::Running) {
215 stopRunning(spriteId); 222 stopRunning(spriteId);
216 } else { 223 } else {
217 if (sprite.characterMedium == CharacterMedium::Ladder) { 224 if (sprite.characterMedium == CharacterMedium::Ladder ||
225 sprite.characterMedium == CharacterMedium::Water) {
218 return; 226 return;
219 } 227 }
220 228
@@ -323,6 +331,17 @@ void CharacterSystem::setAnimationFor(int spriteId, CharacterState state) {
323 331
324 break; 332 break;
325 } 333 }
334 case CharacterMedium::Water: {
335 std::string animName = "swim_still";
336 if (state == CharacterState::Walking) {
337 animName = "swim_walk";
338 }
339
340 game_.getSystem<AnimationSystem>().setSpriteAnimation(spriteId, animName);
341 sprite.hasShadow = false;
342
343 break;
344 }
326 } 345 }
327} 346}
328 347
diff --git a/src/map.cpp b/src/map.cpp index 0425962..23445e4 100644 --- a/src/map.cpp +++ b/src/map.cpp
@@ -47,6 +47,8 @@ Map::Map(std::string_view name) : name_(name) {
47 } else if (property.getName() == "medium") { 47 } else if (property.getName() == "medium") {
48 if (property.getStringValue() == "ladder") { 48 if (property.getStringValue() == "ladder") {
49 tile.medium = CharacterMedium::Ladder; 49 tile.medium = CharacterMedium::Ladder;
50 } else if (property.getStringValue() == "water") {
51 tile.medium = CharacterMedium::Water;
50 } 52 }
51 } 53 }
52 } 54 }
diff --git a/src/sprite.h b/src/sprite.h index bb78442..32a082c 100644 --- a/src/sprite.h +++ b/src/sprite.h
@@ -36,7 +36,8 @@ enum class CharacterState {
36 36
37enum class CharacterMedium { 37enum class CharacterMedium {
38 Normal, 38 Normal,
39 Ladder 39 Ladder,
40 Water
40}; 41};
41 42
42struct Movement { 43struct Movement {