feat: added bias to player depth

This commit is contained in:
Sara 2023-11-26 13:12:41 +01:00
parent 94cc7e8c6c
commit b82c0a5765

View file

@ -25,6 +25,8 @@ typedef struct Player {
Vector moveInput; Vector moveInput;
int attackInput; int attackInput;
int facing;
Sprite* sprite; Sprite* sprite;
AnimationSprite* idle; AnimationSprite* idle;
@ -55,7 +57,7 @@ RigidBody* PlayerGetRigidBody(Player* self);
void PlayerOnCollision(Player* self, Collision collision); void PlayerOnCollision(Player* self, Collision collision);
void PlayerOnOverlap(Player* self, Collider* other); void PlayerOnOverlap(Player* self, Collider* other);
static long PlayerGetDepth(Player* self) { return -(int)(self->transform.position.y * 1000); } static long PlayerGetDepth(Player* self) { return -10-(int)(self->transform.position.y * 1000); }
impl_Drop_for(Player, impl_Drop_for(Player,
DestroyPlayer DestroyPlayer