fuzzyworld

godot-shooter / commit

Lower the damage of a rocket to 2.

a343368e08fc70ec1012e13047e6ac8b39612a77 · Pavel Safronov · 2023-11-09 16:34:59 -0800 · parents 210ccd64e175

Lower the damage of a rocket to 2.
 Rocket.gd | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Rocket.gd b/Rocket.gd
index 9e4bfd0..3e07107 100644
--- a/Rocket.gd
+++ b/Rocket.gd
@@ -6,6 +6,7 @@ const SmallExplosion = preload("res://SmallExplosion.tscn")
 export var lifetime_seconds = 5
 export var speed = 100
 export var arm_secs = 1
+export var damage_amount = 2
 
 func _ready() -> void:
 #	$AnimationPlayer.play("arming")
@@ -19,7 +20,7 @@ func on_bullet_body_entered(body):
 	var players = tree.get_nodes_in_group("player")
 	var player = players[0]
 	if body != player && body.has_method("hurt"):
-		body.hurt(3)
+		body.hurt(damage_amount)
 		var se = SmallExplosion.instance()
 		get_parent().add_child(se)
 		se.transform = transform