aboutsummaryrefslogtreecommitdiff
path: root/scripts/bullet.gd
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/bullet.gd')
-rw-r--r--scripts/bullet.gd6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/bullet.gd b/scripts/bullet.gd
index 9b4434d..994d3d1 100644
--- a/scripts/bullet.gd
+++ b/scripts/bullet.gd
@@ -3,6 +3,8 @@ extends Spatial
var _enemies_holder
var shooter
+var damage = 1
+
var timer = 0
var time_life = 3
var speed = 7
@@ -10,7 +12,7 @@ var hit_something = false
func _ready():
_enemies_holder = get_tree().root.get_child(0).find_node("enemies")
- $Area.connect("body_entered", self, "collided")
+ var _err = $Area.connect("body_entered", self, "collided")
func _physics_process(delta):
var forward_dir = -global_transform.basis.z.normalized()
@@ -27,7 +29,7 @@ func collided(body):
if hit_something == false:
var groups = parent.get_groups()
if "enemies" in groups:
- _enemies_holder.damage(parent.name)
+ _enemies_holder.damage(parent.name, damage)
hit_something = true
queue_free()