diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/player.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/player.c b/src/player.c index fe4af3d..162434a 100644 --- a/src/player.c +++ b/src/player.c @@ -192,7 +192,14 @@ mf_player_render(struct mf_player *p, SDL_Renderer *renderer) cx = p->cur_x * p->cell_width + p->cell_width / 2; cy = p->cur_y * p->cell_width + p->cell_width / 2; switch (p->cur_dir) { - case MF_PLAYER_DIR_U_: cy -= p->travel; fx = 2.0; break; + case MF_PLAYER_DIR_U_: + cy -= p->travel; + if (p->old_dir == MF_PLAYER_DIR_L_) { + fx = -2.0; + } else { + fx = 2.0; + } + break; case MF_PLAYER_DIR_D_: cy += p->travel; fx = 0.0; break; case MF_PLAYER_DIR_L_: cx -= p->travel; fx = -1.0; break; case MF_PLAYER_DIR_R_: cx += p->travel; fx = 1.0; break; |