Closed duianto closed 2 years ago
While indeed the original rect size value is wrong (it's calculated differently), it also calls the same function that reset calls to update it again.
It looks to me that something is blocking the tween from animating to the correct first size?
An easy fix would be to just update the original value to the correct one by using the same formula (190.0 * health / max_health). - And I would prefer using the empty health bars size as reference instead of the magic constant 190.0.
Is your feature request related to a problem? Please describe.
In the first and second code examples in lesson 9: https://gdquest.github.io/learn-gdscript/#course/lesson-9-adding-and-subtracting/lesson.tres
Pressing the
Reset
button shrinks the health progress bar slightly. Compared to when the lesson page was (re)loaded.First example: Before: The progress bar ends to the right of the 5 in
health = 75
:After: The progress bar ends under the 5 in
health = 75
:The same thing happens in the second example:
Before: The progress bar ends under the first letter
h
inhealth = 25
:After: The progress bar ends below the left side of the first letter
h
inhealth = 25
:Describe the solution you'd like The progress bar's initial size should probably match its reset size.
Note
This is most likely a low-priority enhancement. It doesn't affect the lesson's functionality. It's just an observation that pressing the
Reset
button, resizes the progress bar once, from its initial size.