diff options
-rw-r--r-- | src/player.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/player.c b/src/player.c index 126b2ea..40c5f6f 100644 --- a/src/player.c +++ b/src/player.c @@ -38,6 +38,11 @@ enum { PLAYER_A_JUMP, PLAYER_A_FALL, PLAYER_A_FALL2, + PLAYER_A_HOP, + PLAYER_A_HOP2, + PLAYER_A_HOP3, + PLAYER_A_CROUCH, + PLAYER_A_CROUCH2, }; struct anim player_anims[] = { @@ -50,6 +55,11 @@ struct anim player_anims[] = { {PLAYER_A_JUMP, {16, 0, 16, 16}, 300}, {PLAYER_A_FALL2, {32, 0, 16, 16}, 15}, {PLAYER_A_FALL2, {48, 0, 16, 16}, 15}, + {PLAYER_A_HOP2, {16, 0, 16, 16}, 4}, + {PLAYER_A_HOP3, {32, 0, 16, 16}, 4}, + {PLAYER_A_CROUCH, {48, 0, 16, 16}, 4}, + {PLAYER_A_CROUCH2, {64, 0, 16, 16}, 300}, + {PLAYER_A_CROUCH, {80, 0, 16, 16}, 2}, }; enum slash_type { @@ -291,6 +301,7 @@ static int player_update(struct entity *self) { } attack(self, 0, SLASH_NORMAL); if (input_s(input_pressed)) { + anim(self, PLAYER_A_CROUCH); self->state = PLAYER_ATTACK2; self->timer = 30; } @@ -316,6 +327,7 @@ static int player_update(struct entity *self) { } attack(self, 1, SLASH_STRONG); if (input_s(input_pressed)) { + anim(self, PLAYER_A_HOP); self->state = PLAYER_ATTACK3; self->timer = 60; } @@ -340,6 +352,7 @@ static int player_update(struct entity *self) { self->state = PLAYER_JUMP; } if (self->timer-- == 0) { + anim(self, PLAYER_A_IDLE); self->state = PLAYER_IDLE; } break; |