aboutsummaryrefslogtreecommitdiff
path: root/game/player/PlayerScript.cpp
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2025-01-09 21:15:06 +0100
committerJAROWMR <jarorutjes07@gmail.com>2025-01-09 21:15:06 +0100
commit5863e43cdbf19738dabbd285e92622d740c72f71 (patch)
tree77e2af84b538498e5de2113d18dd3ee10c6139bc /game/player/PlayerScript.cpp
parentf6683fa71fa670cfbe6aa6233fafb869295da11a (diff)
parent8b32dbc33c434f84b4aab98819147c3b8416ff69 (diff)
Merge branch 'master' of github.com:lonkaars/crepe into jaro/game
Diffstat (limited to 'game/player/PlayerScript.cpp')
-rw-r--r--game/player/PlayerScript.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/game/player/PlayerScript.cpp b/game/player/PlayerScript.cpp
index 57819c0..fadca9c 100644
--- a/game/player/PlayerScript.cpp
+++ b/game/player/PlayerScript.cpp
@@ -2,6 +2,7 @@
#include "../Config.h"
#include "../enemy/BattleScript.h"
+
#include <crepe/api/Animator.h>
#include <crepe/api/AudioSource.h>
#include <crepe/api/BoxCollider.h>
@@ -126,7 +127,8 @@ void PlayerScript::fixed_update(crepe::duration_t dt) {
current_jetpack_sound = 0;
}
} else if (transform.position.y == 195) {
- if (prev_anim != 0) {
+ Rigidbody & rb = this->get_components_by_name<Rigidbody>("player").front();
+ if (prev_anim != 0 && rb.data.linear_velocity.x != 0) {
for (Animator & anim : animators) {
anim.active = true;
anim.set_anim(0);