Skip to content

Commit

Permalink
make icon movement less linear
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesisfeline committed Jul 17, 2024
1 parent 9c8652c commit be9293c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/funkin/play/components/HealthIcon.hx
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,13 @@ class HealthIcon extends FunkinSprite
if (this.width > this.height)
{
// Apply linear interpolation while accounting for frame rate.
var targetSize:Int = Std.int(MathUtil.coolLerp(this.width, HEALTH_ICON_SIZE * this.size.x, 0.15));
var targetSize:Float = MathUtil.coolLerp(this.width, HEALTH_ICON_SIZE * this.size.x, 0.15);

setGraphicSize(targetSize, 0);
}
else
{
var targetSize:Int = Std.int(MathUtil.coolLerp(this.height, HEALTH_ICON_SIZE * this.size.y, 0.15));
var targetSize:Float = MathUtil.coolLerp(this.height, HEALTH_ICON_SIZE * this.size.y, 0.15);

setGraphicSize(0, targetSize);
}
Expand Down Expand Up @@ -267,11 +267,11 @@ class HealthIcon extends FunkinSprite
// Make the icon increase in size (the update function causes them to lerp back down).
if (this.width > this.height)
{
setGraphicSize(Std.int(this.width + (HEALTH_ICON_SIZE * this.size.x * BOP_SCALE)), 0);
setGraphicSize(this.width + (HEALTH_ICON_SIZE * this.size.x * BOP_SCALE), 0);
}
else
{
setGraphicSize(0, Std.int(this.height + (HEALTH_ICON_SIZE * this.size.y * BOP_SCALE)));
setGraphicSize(0, this.height + (HEALTH_ICON_SIZE * this.size.y * BOP_SCALE));
}
// Make the icon twist (the update function causes them to lerp back to normal).
this.angle += bopAngle * (playerId == 0 ? 1 : -1);
Expand Down

0 comments on commit be9293c

Please sign in to comment.