add enemy hitbox and refactor to characterBody2d
This commit is contained in:
9
hit_box.gd
Normal file
9
hit_box.gd
Normal file
@@ -0,0 +1,9 @@
|
||||
extends Area2D
|
||||
|
||||
@onready var hit_sound: AudioStreamPlayer2D = $HitSound
|
||||
signal killed()
|
||||
|
||||
func _on_body_entered(_body: Node2D) -> void:
|
||||
hit_sound.play()
|
||||
killed.emit()
|
||||
|
||||
Reference in New Issue
Block a user