feat(game): player and prop now implement get depth for behaviour entity

This commit is contained in:
Sara 2023-11-25 11:34:10 +01:00
parent 966f7b9efe
commit 1bba6c86f1
2 changed files with 8 additions and 2 deletions

View file

@ -56,6 +56,8 @@ Shape* PlayerGetCollisionShape(Player* self);
void PlayerOnCollision(Player* self, Collision collision); void PlayerOnCollision(Player* self, Collision collision);
void PlayerOnOverlap(Player* self, PhysicsEntity other); void PlayerOnOverlap(Player* self, PhysicsEntity other);
static long PlayerGetDepth(Player* self) { return -(int)(self->transform.position.y * 1000); }
impl_Drop_for(Player, impl_Drop_for(Player,
DestroyPlayer DestroyPlayer
) )
@ -63,7 +65,8 @@ impl_Drop_for(Player,
impl_BehaviourEntity_for(Player, impl_BehaviourEntity_for(Player,
PlayerStart, PlayerStart,
PlayerUpdate, PlayerUpdate,
PlayerDraw PlayerDraw,
PlayerGetDepth
) )
impl_Transformable_for(Player, impl_Transformable_for(Player,

View file

@ -32,6 +32,8 @@ Transform* PropGetTransform(Prop* self);
RigidBody* PropGetRigidBody(Prop* self); RigidBody* PropGetRigidBody(Prop* self);
Shape* PropGetCollisionShape(Prop* self); Shape* PropGetCollisionShape(Prop* self);
static long PropGetDepth(Prop* self) { return -(int)(self->transform.position.y * 1000); }
impl_Transformable_for(Prop, impl_Transformable_for(Prop,
PropGetTransform PropGetTransform
) )
@ -50,7 +52,8 @@ impl_Drop_for(Prop,
impl_BehaviourEntity_for(Prop, impl_BehaviourEntity_for(Prop,
PropStart, PropStart,
PropUpdate, PropUpdate,
PropDraw PropDraw,
PropGetDepth
) )
#endif // !FIGHT_PROP_H #endif // !FIGHT_PROP_H