From 57b341f515df3a62f18bcc6205649a394d41a09f Mon Sep 17 00:00:00 2001 From: Haze Weathers Date: Wed, 8 Mar 2023 19:18:26 -0500 Subject: [PATCH] another week, another OUTSiDE iDle TIMEgit statusgit status console error squelched --- objects/player/arrow_projectile.gd | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/objects/player/arrow_projectile.gd b/objects/player/arrow_projectile.gd index 41279c0..e4bedf3 100644 --- a/objects/player/arrow_projectile.gd +++ b/objects/player/arrow_projectile.gd @@ -24,6 +24,7 @@ func _physics_process(delta): position.x += speed * direction * delta #Delete when offscreen if Game.get_sector(global_position + cull_edge) != initial_sector: + _persist_trail() queue_free() #Wall Collision @@ -31,6 +32,7 @@ func _on_Hitbox_body_entered(body): if breaks_on_wall: if body is TileMap or body is StaticBody2D: _make_sparks() + _persist_trail() queue_free() # kill entity if in target group @@ -49,13 +51,14 @@ func _on_Hitbox_area_entered(area): #decrease arrows if enemy killed if target_group == "enemy_hitbox": Game.arrows = max(0, Game.arrows - 1) # clamp arrows above 0 + _persist_trail() queue_free() elif area.is_in_group("arrow"): _make_sparks() + _persist_trail() queue_free() -func _exit_tree(): - # make sure particles node sticks around until particles decay +func _persist_trail(): var particles = $DustParticles remove_child(particles) get_parent().add_child(particles)