diff --git a/game/src/PlayerStates.c b/game/src/PlayerStates.c index b4ee427..b7a9d5b 100644 --- a/game/src/PlayerStates.c +++ b/game/src/PlayerStates.c @@ -1,12 +1,15 @@ #include "PlayerStates.h" #include "Player.h" +#include "physics_world.h" +#include "debug.h" static inline void InternalSpriteFlipWithMovement(Player* self) { if(self->moveInput.x > 0.f) - sprite_flip_horizontal(self->sprite, 0); + self->facing = 1; if(self->moveInput.x < -0.1f) - sprite_flip_horizontal(self->sprite, 1); + self->facing = -1; + sprite_flip_horizontal(self->sprite, self->facing != 1); } void PlayerAnimationExit(Player* self) {} @@ -51,6 +54,11 @@ void PlayerJabA_Enter(Player* self) { PlayerAttackEnter(self); self->currentAnimation = self->jab_a; animation_sprite_play_from(self->currentAnimation, 0.f); + + Collider* found = physics_world_box_query(vaddf(self->transform.position, MakeVector(self->facing * (0.2f + 0.05f), 0.f)), + MakeVector(0.05f, 0.06f), PHYSICS_LAYER_DEFAULT, self->rigidbody); + if(found != NULL) + LOG_INFO("Query returned %p", found); } const State* PlayerJabA_Update(Player* self, float deltaTime) {