Skip to content

Health and Death #358

@caelunshun

Description

@caelunshun

Reimplement health and death. This feature existed before #307 but was lost in the rewrite. You can refer to the old directory for how it was previously implemented.

In short, we want:

  • A Health component containing an entity's health and its max health, with methods to deal damage and regenerate.
  • A system that queries for all entities with Health components and removes the entities if health == 0. For players, we instead want to respawn them, which is trickier. It involves sending the ChangeGameState packet and waiting for the client to send ClientStatus. The hard part here is that the player should not be visible to the game while they are in the respawn menu. I'm not sure what the best way to implement this is.
  • To test health, implement fall damage. This entails a system that checks the Position and OnGround components each tick and computes how far an entity has fallen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions