diff --git a/game/src/Player.h b/game/src/Player.h index 445b539..fda0b33 100644 --- a/game/src/Player.h +++ b/game/src/Player.h @@ -56,6 +56,8 @@ Shape* PlayerGetCollisionShape(Player* self); void PlayerOnCollision(Player* self, Collision collision); void PlayerOnOverlap(Player* self, PhysicsEntity other); +static long PlayerGetDepth(Player* self) { return -(int)(self->transform.position.y * 1000); } + impl_Drop_for(Player, DestroyPlayer ) @@ -63,7 +65,8 @@ impl_Drop_for(Player, impl_BehaviourEntity_for(Player, PlayerStart, PlayerUpdate, - PlayerDraw + PlayerDraw, + PlayerGetDepth ) impl_Transformable_for(Player, diff --git a/game/src/Prop.h b/game/src/Prop.h index 333fcfe..2dd03a4 100644 --- a/game/src/Prop.h +++ b/game/src/Prop.h @@ -32,6 +32,8 @@ Transform* PropGetTransform(Prop* self); RigidBody* PropGetRigidBody(Prop* self); Shape* PropGetCollisionShape(Prop* self); +static long PropGetDepth(Prop* self) { return -(int)(self->transform.position.y * 1000); } + impl_Transformable_for(Prop, PropGetTransform ) @@ -50,7 +52,8 @@ impl_Drop_for(Prop, impl_BehaviourEntity_for(Prop, PropStart, PropUpdate, - PropDraw + PropDraw, + PropGetDepth ) #endif // !FIGHT_PROP_H