feat(player): animacions stun_* durant l'aterratge

This commit is contained in:
JailDesigner committed 2026-04-25 13:48:03 +02:00
1 parent 3a750822f6
commit f3f5fa5e92
7 files changed
+26 -6

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

+6 -3
View File
@@ -32,9 +32,12 @@ animations:
stand_down: { frames: [0] } stand_down: { frames: [0] }
stand_up: { frames: [4] } stand_up: { frames: [4] }
stand: { frames: [8] } stand: { frames: [8] }
jump_down: { frames: [0] } jump_down: { frames: [12] }
jump_up: { frames: [4] } jump_up: { frames: [13] }
jump: { frames: [8] } jump: { frames: [14] }
stun_down: { frames: [16] }
stun_up: { frames: [17] }
stun: { frames: [18] }
walk_down: walk_down:
frames: [0, 1, 2, 3] frames: [0, 1, 2, 3]
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

+6 -3
View File
@@ -32,9 +32,12 @@ animations:
stand_down: { frames: [1] } stand_down: { frames: [1] }
stand_up: { frames: [5] } stand_up: { frames: [5] }
stand: { frames: [9] } stand: { frames: [9] }
jump_down: { frames: [1] } jump_down: { frames: [12] }
jump_up: { frames: [5] } jump_up: { frames: [13] }
jump: { frames: [9] } jump: { frames: [14] }
stun_down: { frames: [16] }
stun_up: { frames: [17] }
stun: { frames: [18] }
walk_down: walk_down:
frames: [0, 1, 2, 3] frames: [0, 1, 2, 3]
Binary file not shown.
Binary file not shown.
+14
View File
@@ -757,6 +757,20 @@ auto Player::animationName(bool moving) const -> const char* {
} }
return "jump"; return "jump";
} }
// En LANDING_STUN, `stun_*` (per direcció): mostrem el frame
// d'aterratge fins que s'esgota el timer. La direcció ve fixada del
// moment del despegue (no es canvia mentre estem en l'aire).
if (state_ == State::LANDING_STUN) {
switch (facing_) {
case Facing::UP:
return "stun_up";
case Facing::DOWN:
return "stun_down";
case Facing::SIDE:
break;
}
return "stun";
}
switch (facing_) { switch (facing_) {
case Facing::UP: case Facing::UP:
return moving ? "walk_up" : "stand_up"; return moving ? "walk_up" : "stand_up";