Skip to content

Commit

Permalink
slightly better health system
Browse files Browse the repository at this point in the history
it's shortened now woohoo
  • Loading branch information
charlesisfeline authored Nov 27, 2023
1 parent e98b3ab commit 5058937
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions source/states/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1710,12 +1710,15 @@ class PlayState extends MusicBeatState
iconP2.updateHitbox();

var iconOffset:Int = 26;
if (healthBar.bounds.max != null) {
/*if (healthBar.bounds.max != null) {
if (health > healthBar.bounds.max) health = healthBar.bounds.max;
} else {
// Old system for safety?? idk
if (health > 2) health = 2;
}
}*/

health = FlxMath.bound(health, 0, (healthBar.bounds.max != null ? healthBar.bounds.max : 2));

iconP1.x = healthBar.barCenter + (150 * iconP1.scale.x - 150) / 2 - iconOffset;
iconP2.x = healthBar.barCenter - (150 * iconP2.scale.x) / 2 - iconOffset * 2;

Expand Down

0 comments on commit 5058937

Please sign in to comment.