summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/player.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/player.c b/src/player.c
index 9e1a782..76e6349 100644
--- a/src/player.c
+++ b/src/player.c
@@ -18,6 +18,8 @@
#define TOP_SPEEDY 100
#define ACCEL_X 200
+#define WALK_FRAME_TIME 0.2
+
extern Texture character_spritesheet;
void add_player_animations(struct entity* player);
@@ -112,7 +114,7 @@ void handle_fall(struct entity* player) {
void handle_flip(struct entity* player) {
if (player->velocity.x < 0) {
player->flip = true;
- } else {
+ } else if (player->velocity.x > 0){
player->flip = false;
}
}
@@ -164,6 +166,6 @@ void add_player_animations(struct entity* player) {
{.x = 0, .y = 129, .width = 128, .height = 128},
{.x = 129, .y = 129, .width = 128, .height = 128}
},
- .frame_times = {0.2, 0.2}
+ .frame_times = {WALK_FRAME_TIME, WALK_FRAME_TIME}
};
}