init
This commit is contained in:
13
general/hurtbox/hurtbox.gd
Normal file
13
general/hurtbox/hurtbox.gd
Normal file
@@ -0,0 +1,13 @@
|
||||
class_name Hurtbox extends Area2D
|
||||
|
||||
@export var damage: int = 1
|
||||
|
||||
func _ready() -> void:
|
||||
area_entered.connect(hurtbox_entered)
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
pass
|
||||
|
||||
func hurtbox_entered(area: Area2D) -> void:
|
||||
if area is Hitbox:
|
||||
area.take_damage(self)
|
||||
1
general/hurtbox/hurtbox.gd.uid
Normal file
1
general/hurtbox/hurtbox.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://c0fmav64y2rrk
|
||||
9
general/hurtbox/hurtbox.tscn
Normal file
9
general/hurtbox/hurtbox.tscn
Normal file
@@ -0,0 +1,9 @@
|
||||
[gd_scene format=3 uid="uid://mwyvk4gke34"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c0fmav64y2rrk" path="res://general/hurtbox/hurtbox.gd" id="1_85hd5"]
|
||||
|
||||
[node name="Hurtbox" type="Area2D" unique_id=38213362]
|
||||
collision_layer = 0
|
||||
collision_mask = 2
|
||||
monitorable = false
|
||||
script = ExtResource("1_85hd5")
|
||||
Reference in New Issue
Block a user