- using getter for receiving values from globals (pill _max)

This commit is contained in:
SyntaX 2019-11-21 10:41:57 +01:00
parent 0c3d96030b
commit 130584c4e2
2 changed files with 7 additions and 2 deletions

View File

@ -11,7 +11,7 @@ func _ready():
_pillLevel = get_node("TextureProgress")
# TODO: may use global values in Inspector?
_pillLevel.max_value = Pills._max
_pillLevel.max_value = Pills.get_max()
func add_item (name):

View File

@ -8,8 +8,13 @@ var _decrease_per_second: float = 0.2
var _pill_add_amount: float = 2.0
# Returns the max level
func get_max() -> float:
return _max
# Returns the exact current level as a floating point number between min and max
func get_level():
func get_level() -> float:
return _level