Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(player): implement player's health and healthbar #41

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Slocaly
Copy link
Contributor

@Slocaly Slocaly commented Feb 19, 2025

Description

Closes #31

Add life and an healthbar for the player

  • Add life that decrease when hit
  • Add a 'Hit' animation for when the player is ... well ... hit ! :D
  • Add a 'Death' animation for when the player die
  • Add a healthbar for the player

Screenshots (if appropriate):

Enregistrement.de.l.ecran.2025-02-19.a.08.27.57.mov

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

healthbar.value = lifePoint

if (lifePoint == 0):
$AnimationPlayer.play("Death")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This animation only make the healthbar disappear no ? I don't see the AnimatedSprite disappear smoothly when this happen 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did I miss this, it's strange, I try to fix it ...

@olivierperez olivierperez force-pushed the feat/add-player-life branch from 19d70f3 to cdddc6a Compare March 3, 2025 13:27
@olivierperez olivierperez force-pushed the feat/add-player-life branch from cdddc6a to 552536f Compare March 3, 2025 13:29
@olivierperez olivierperez changed the title feat(player): add player healthbar feat(player): implement player's health and healthbar Mar 3, 2025
Copy link
Member

@olivierperez olivierperez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me it's almost good, you need to let clicks event "pass" through progress bar.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(player): take damage on mob attack
3 participants