Move exaust and regen speeds to the top of the script
This commit is contained in:
@ -19,6 +19,8 @@ var status = {
|
||||
"health": 100,
|
||||
"stamina": 100,
|
||||
"exausted": false,
|
||||
"exaust_speed": 1,
|
||||
"stamina_regen_speed": 0.5,
|
||||
"level": 1
|
||||
}
|
||||
var current_tool = "none"
|
||||
@ -57,13 +59,13 @@ func _process(_delta):
|
||||
|
||||
if is_sprinting:
|
||||
speed = sprint_speed
|
||||
status.stamina -= 1
|
||||
status.stamina -= status.exaust_speed
|
||||
if status.stamina <= 0:
|
||||
is_sprinting = false
|
||||
status.exausted = true
|
||||
else:
|
||||
if status.stamina < 100:
|
||||
status.stamina += 0.5
|
||||
status.stamina += status.stamina_regen_speed
|
||||
if status.exausted:
|
||||
speed = exausted_speed
|
||||
else:
|
||||
|
Reference in New Issue
Block a user