The sounds, they are working!
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
class_name HurtBox
|
||||
extends Area
|
||||
|
||||
onready var Slap = $AudioSlap
|
||||
onready var MegaSlap = $AudioMegaSlap
|
||||
|
||||
func _init():
|
||||
collision_layer = 0
|
||||
collision_mask = 2
|
||||
@@ -14,7 +17,12 @@ func _on_area_entered(hitbox: HitBox):
|
||||
if hitbox.hitbox_type == hitbox.HitboxType.Unassigned:
|
||||
return
|
||||
|
||||
|
||||
if hitbox.hitbox_type == hitbox.HitboxType.Slap and owner.has_method("get_slapped"):
|
||||
owner.get_slapped(hitbox.slap_level,hitbox.slap_kill, hitbox.slap_vector)
|
||||
if hitbox.slap_level >= hitbox.slap_kill:
|
||||
MegaSlap.play()
|
||||
else:
|
||||
Slap.play()
|
||||
elif hitbox.hitbox_type == hitbox.HitboxType.Projectile and owner.has_method("get_shot"):
|
||||
owner.get_shot(hitbox.owner)
|
||||
|
Reference in New Issue
Block a user