fuzzyworld

godot-shooter / commit

Player's shield does not auto-regenerate, need a pickup every time.

db2a699d68ad5193e9b22c1128ffe33b7277dfee · Pavel Safronov · 2023-11-08 12:03:49 -0800 · parents 9dfa089398d5

Player's shield does not auto-regenerate, need a pickup every time.
 Player.gd | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/Player.gd b/Player.gd
index 9e3eba5..9018241 100644
--- a/Player.gd
+++ b/Player.gd
@@ -10,7 +10,7 @@ export var is_invincible = false
 export var turn_rate = 0.03
 export var shooting_range = 500
 export var shield_active = true
-export var shield_restart_period_seconds = 5
+#export var shield_restart_period_seconds = 5
 
 var PopupControl = preload("res://Popup.tscn")
 
@@ -79,12 +79,12 @@ func hurt(damage_amount: int = 1):
 		return
 	if shield_active:
 		disable_shield()
-		var timer = Timer.new()
-		timer.wait_time = shield_restart_period_seconds
-		timer.one_shot = true
-		timer.connect("timeout", self, "enable_shield")
-		add_child(timer)
-		timer.start()
+#		var timer = Timer.new()
+#		timer.wait_time = shield_restart_period_seconds
+#		timer.one_shot = true
+#		timer.connect("timeout", self, "enable_shield")
+#		add_child(timer)
+#		timer.start()
 	else:
 		health -= damage_amount
 		if health <= 0: