diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-24 17:50:06 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-24 17:50:06 -0500 |
commit | 7747a943b1831eca1be213610a729f8071ebd5d7 (patch) | |
tree | b6265f43be9b9c21bba92d855d870630d7df5c40 | |
parent | a3585e9928f290465e514f0eef3baa147679f075 (diff) | |
download | tanetane-7747a943b1831eca1be213610a729f8071ebd5d7.tar.gz tanetane-7747a943b1831eca1be213610a729f8071ebd5d7.tar.bz2 tanetane-7747a943b1831eca1be213610a729f8071ebd5d7.zip |
Added animation for being in a hot spring
-rw-r--r-- | res/maps/hallucination.tsx | 30 | ||||
-rw-r--r-- | res/sprites/boney.png | bin | 77904 -> 79614 bytes | |||
-rw-r--r-- | res/sprites/boney_anim.txt | 18 | ||||
-rw-r--r-- | res/sprites/boney_frames.txt | 10 | ||||
-rw-r--r-- | res/sprites/duster.png | bin | 97607 -> 99956 bytes | |||
-rw-r--r-- | res/sprites/duster_anim.txt | 18 | ||||
-rw-r--r-- | res/sprites/duster_frames.txt | 18 | ||||
-rw-r--r-- | res/sprites/kuma_anim.txt | 18 | ||||
-rw-r--r-- | res/sprites/kumatora.png | bin | 67143 -> 68906 bytes | |||
-rw-r--r-- | res/sprites/kumatora_frames.txt | 18 | ||||
-rw-r--r-- | res/sprites/lucas.png | bin | 90846 -> 96860 bytes | |||
-rw-r--r-- | res/sprites/lucas_anim.txt | 18 | ||||
-rw-r--r-- | res/sprites/lucas_frames.txt | 37 | ||||
-rw-r--r-- | src/character_system.cpp | 23 | ||||
-rw-r--r-- | src/map.cpp | 2 | ||||
-rw-r--r-- | src/sprite.h | 3 |
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 | |||
49 | barking[right]: 6,38,46,38,46,38,46 | 49 | barking[right]: 6,38,46,38,46,38,46 |
50 | barking[down_right]: 7,39,47,39,47,39,47 | 50 | barking[down_right]: 7,39,47,39,47,39,47 |
51 | climb[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 | 51 | climb[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 |
52 | climb[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 | 52 | climb[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 |
53 | swim_still[down]: 366 | ||
54 | swim_still[down_left]: 367 | ||
55 | swim_still[left]: 368 | ||
56 | swim_still[up_left]: 369 | ||
57 | swim_still[up]: 370 | ||
58 | swim_still[up_right]: 371 | ||
59 | swim_still[right]: 372 | ||
60 | swim_still[down_right]: 373 | ||
61 | swim_walk[down]: 366 | ||
62 | swim_walk[down_left]: 367 | ||
63 | swim_walk[left]: 368 | ||
64 | swim_walk[up_left]: 369 | ||
65 | swim_walk[up]: 370 | ||
66 | swim_walk[up_right]: 371 | ||
67 | swim_walk[right]: 372 | ||
68 | swim_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 @@ | |||
1 | 32,32 cell size | 1 | 32,32 cell size |
2 | 10 frames per row | 2 | 10 frames per row |
3 | 366 frames | 3 | 374 frames |
4 | 4 | ||
5 | 16,24,8,24 | 5 | 16,24,8,24 |
6 | 32,24,16,24 | 6 | 32,24,16,24 |
@@ -368,3 +368,11 @@ | |||
368 | 16,24,8,21 | 368 | 16,24,8,21 |
369 | 17,24,9,21 | 369 | 17,24,9,21 |
370 | 17,24,8,21 | 370 | 17,24,8,21 |
371 | 16,16,8,16 | ||
372 | 16,16,9,16 | ||
373 | 32,16,16,16 | ||
374 | 32,16,16,16 | ||
375 | 16,16,8,16 | ||
376 | 32,16,16,16 | ||
377 | 32,16,16,16 | ||
378 | 16,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 | |||
41 | run[right]: 78,86,94,102,110 | 41 | run[right]: 78,86,94,102,110 |
42 | run[down_right]: 79,87,95,103,111 | 42 | run[down_right]: 79,87,95,103,111 |
43 | climb[up]%60: 200#10,201,202,208#10,207,206,203#10,204,205,208#10,207,206 | 43 | climb[up]%60: 200#10,201,202,208#10,207,206,203#10,204,205,208#10,207,206 |
44 | climb[down]%60: 200#10,201,202,208#10,207,206,203#10,204,205,208#10,207,206 \ No newline at end of file | 44 | climb[down]%60: 200#10,201,202,208#10,207,206,203#10,204,205,208#10,207,206 |
45 | swim_still[down]: 331#57,339,331,339 | ||
46 | swim_still[down_left]: 332#57,332,340,332 | ||
47 | swim_still[left]: 333#57,341,333,341 | ||
48 | swim_still[up_left]: 334 | ||
49 | swim_still[up]: 335 | ||
50 | swim_still[up_right]: 336 | ||
51 | swim_still[right]: 337#57,345,337,345 | ||
52 | swim_still[down_right]: 338#57,346,338,346 | ||
53 | swim_walk[down]: 331 | ||
54 | swim_walk[down_left]: 332 | ||
55 | swim_walk[left]: 333 | ||
56 | swim_walk[up_left]: 334 | ||
57 | swim_walk[up]: 335 | ||
58 | swim_walk[up_right]: 336 | ||
59 | swim_walk[right]: 337 | ||
60 | swim_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 @@ | |||
1 | 40,32 cell size | 1 | 40,32 cell size |
2 | 10 frames per row | 2 | 10 frames per row |
3 | 331 frames | 3 | 347 frames |
4 | 4 | ||
5 | 32,32,16,32 | 5 | 32,32,16,32 |
6 | 32,32,16,32 | 6 | 32,32,16,32 |
@@ -333,3 +333,19 @@ | |||
333 | 32,32,16,32 | 333 | 32,32,16,32 |
334 | 33,32,17,32 | 334 | 33,32,17,32 |
335 | 33,32,16,32 | 335 | 33,32,16,32 |
336 | 32,24,16,24 | ||
337 | 32,24,16,24 | ||
338 | 32,24,16,24 | ||
339 | 32,24,16,24 | ||
340 | 32,24,16,24 | ||
341 | 32,24,16,24 | ||
342 | 32,24,16,24 | ||
343 | 32,24,16,24 | ||
344 | 32,24,16,24 | ||
345 | 32,24,16,24 | ||
346 | 32,24,16,24 | ||
347 | 32,24,16,24 | ||
348 | 32,24,16,24 | ||
349 | 32,24,16,24 | ||
350 | 32,24,16,24 | ||
351 | 32,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 | |||
49 | talk[right]: 38,46 | 49 | talk[right]: 38,46 |
50 | talk[down_right]: 39,47 | 50 | talk[down_right]: 39,47 |
51 | climb[up]%60: 257#10,258,259,265#10,264,263,260#10,261,262,265#10,264,263 | 51 | climb[up]%60: 257#10,258,259,265#10,264,263,260#10,261,262,265#10,264,263 |
52 | climb[down]%60: 257#10,258,259,265#10,264,263,260#10,261,262,265#10,264,263 \ No newline at end of file | 52 | climb[down]%60: 257#10,258,259,265#10,264,263,260#10,261,262,265#10,264,263 |
53 | swim_still[down]: 274#80,282,274,282 | ||
54 | swim_still[down_left]: 275#80,283,275,283 | ||
55 | swim_still[left]: 276#80,284,276,284 | ||
56 | swim_still[up_left]: 277 | ||
57 | swim_still[up]: 278 | ||
58 | swim_still[up_right]: 279 | ||
59 | swim_still[right]: 280#80,288,280,288 | ||
60 | swim_still[down_right]: 281#80,289,281,289 | ||
61 | swim_walk[down]: 274 | ||
62 | swim_walk[down_left]: 275 | ||
63 | swim_walk[left]: 276 | ||
64 | swim_walk[up_left]: 277 | ||
65 | swim_walk[up]: 278 | ||
66 | swim_walk[up_right]: 279 | ||
67 | swim_walk[right]: 280 | ||
68 | swim_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 @@ | |||
1 | 33,32 cell size | 1 | 33,32 cell size |
2 | 10 frames per row | 2 | 10 frames per row |
3 | 274 frames | 3 | 290 frames |
4 | 4 | ||
5 | 32,32,16,32 | 5 | 32,32,16,32 |
6 | 32,32,16,32 | 6 | 32,32,16,32 |
@@ -276,3 +276,19 @@ | |||
276 | 32,32,16,32 | 276 | 32,32,16,32 |
277 | 32,32,17,32 | 277 | 32,32,17,32 |
278 | 32,32,15,32 | 278 | 32,32,15,32 |
279 | 32,16,16,16 | ||
280 | 32,16,16,16 | ||
281 | 16,16,7,16 | ||
282 | 16,16,7,16 | ||
283 | 32,16,16,16 | ||
284 | 16,16,9,16 | ||
285 | 16,16,9,16 | ||
286 | 32,16,16,16 | ||
287 | 32,16,16,16 | ||
288 | 32,16,16,16 | ||
289 | 16,16,7,16 | ||
290 | 16,16,7,16 | ||
291 | 16,16,7,16 | ||
292 | 16,16,7,16 | ||
293 | 16,16,9,16 | ||
294 | 32,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 | |||
43 | lightning_electrocute![down]: 116,117,118,116,117,118 | 43 | lightning_electrocute![down]: 116,117,118,116,117,118 |
44 | lightning_collapse![down]: 119,120,121,122 | 44 | lightning_collapse![down]: 119,120,121,122 |
45 | climb[up]%60: 123#10,124,125,128#10,127,126,129#10,130,131,128#10,127,126 | 45 | climb[up]%60: 123#10,124,125,128#10,127,126,129#10,130,131,128#10,127,126 |
46 | climb[down]%60: 123#10,124,125,128#10,127,126,129#10,130,131,128#10,127,126 \ No newline at end of file | 46 | climb[down]%60: 123#10,124,125,128#10,127,126,129#10,130,131,128#10,127,126 |
47 | swim_still[down]: 399#53,407,399,407 | ||
48 | swim_still[down_left]: 400#53,408,400,408 | ||
49 | swim_still[left]: 401#53,409,401,409 | ||
50 | swim_still[up_left]: 402 | ||
51 | swim_still[up]: 403 | ||
52 | swim_still[up_right]: 404 | ||
53 | swim_still[right]: 405#53,413,405,413 | ||
54 | swim_still[down_right]: 406#53,414,406,414 | ||
55 | swim_walk[down]: 399 | ||
56 | swim_walk[down_left]: 400 | ||
57 | swim_walk[left]: 401 | ||
58 | swim_walk[up_left]: 402 | ||
59 | swim_walk[up]: 403 | ||
60 | swim_walk[up_right]: 404 | ||
61 | swim_walk[right]: 405 | ||
62 | swim_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 @@ | |||
1 | 32,64 cell size | 1 | 32,64 cell size |
2 | 10 frames per row | 2 | 10 frames per row |
3 | 399 frames | 3 | 434 frames |
4 | 4 | ||
5 | 16,32,8,32 | 5 | 16,32,8,32 |
6 | 16,32,8,32 | 6 | 16,32,8,32 |
@@ -401,3 +401,38 @@ | |||
401 | 16,24,9,25 | 401 | 16,24,9,25 |
402 | 16,24,9,24 | 402 | 16,24,9,24 |
403 | 16,32,8,32 | 403 | 16,32,8,32 |
404 | 16,16,8,15 | ||
405 | 16,16,8,15 | ||
406 | 16,16,8,15 | ||
407 | 16,16,8,15 | ||
408 | 16,16,9,15 | ||
409 | 16,16,9,15 | ||
410 | 16,16,9,15 | ||
411 | 16,16,9,15 | ||
412 | 16,16,8,15 | ||
413 | 16,16,8,15 | ||
414 | 16,16,8,15 | ||
415 | 16,16,8,15 | ||
416 | 16,16,8,15 | ||
417 | 16,16,8,15 | ||
418 | 16,16,9,15 | ||
419 | 16,16,9,15 | ||
420 | 32,32,15,23 | ||
421 | 32,32,15,23 | ||
422 | 32,32,15,23 | ||
423 | 16,24,8,23 | ||
424 | 16,16,8,15 | ||
425 | 16,16,8,15 | ||
426 | 16,16,8,15 | ||
427 | 16,24,8,15 | ||
428 | 16,24,8,15 | ||
429 | 16,24,8,15 | ||
430 | 16,24,8,15 | ||
431 | 16,24,8,15 | ||
432 | 16,24,8,15 | ||
433 | 16,16,8,15 | ||
434 | 32,24,16,23 | ||
435 | 32,24,16,23 | ||
436 | 32,32,16,23 | ||
437 | 32,24,16,15 | ||
438 | 32,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 | ||
37 | enum class CharacterMedium { | 37 | enum class CharacterMedium { |
38 | Normal, | 38 | Normal, |
39 | Ladder | 39 | Ladder, |
40 | Water | ||
40 | }; | 41 | }; |
41 | 42 | ||
42 | struct Movement { | 43 | struct Movement { |