scrump projectile disapear on collision and better disappear graphics (closes #190)

This commit is contained in:
Haze Weathers 2023-10-16 09:29:39 -04:00
parent f3d5446d66
commit 1e472333a5
2 changed files with 28 additions and 12 deletions

View file

@ -1,10 +1,26 @@
extends "res://objects/enemy/enemy.gd"
func _physics_process(delta):
position.x -= 80 * delta
var speed: float = 80.0
func _on_Hitbox_area_entered(area):
func _physics_process(delta: float) -> void:
position.x -= speed * delta
func _on_Hitbox_area_entered(area: Node) -> void:
._on_Hitbox_area_entered(area)
if area.is_in_group("player_hitbox"):
self.queue_free()
_stop()
func _on_Hitbox_body_entered(body: Node) -> void:
if body is TileMap:
_stop()
func _stop() -> void:
speed = 0.0
$Hitbox.queue_free()
for child in $Particles.get_children():
if child is CPUParticles2D:
child.emitting = false