Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Commit

Permalink
Player looses damage till 0 now
Browse files Browse the repository at this point in the history
  • Loading branch information
NelDav committed Jun 23, 2019
1 parent 9b8a438 commit e502984
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions godot/src/scripts/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,21 @@ public double Health
get => health;
set
{
if ((value >= 0 && value <= 100) || value == double.PositiveInfinity)
if(value < 0)
{
health = 0;
}
else if(value > 100)
{
health = 100;
}
else
{
health = value;
//sends an signal about
EmitSignal(nameof(HealthChangeSignal), Health);
}

//sends an signal about
EmitSignal(nameof(HealthChangeSignal), Health);
}
}

Expand Down

0 comments on commit e502984

Please sign in to comment.