Kinda have a working hit/hurtbox model again.

This commit is contained in:
Nitsud Yarg 2024-06-02 13:58:49 -07:00
parent 1a743214d7
commit 74dc378791
5 changed files with 8 additions and 5 deletions

View File

@ -3,8 +3,6 @@
[ext_resource path="res://src/components/Hurtbox_Component.gd" type="Script" id=1]
[node name="Hurtbox_Component" type="Area2D"]
collision_layer = 16
collision_mask = 128
script = ExtResource( 1 )
[connection signal="body_entered" from="." to="." method="_on_Hurtbox_Component_body_entered"]
[connection signal="area_shape_entered" from="." to="." method="_on_Hurtbox_Component_area_shape_entered"]

View File

@ -177,6 +177,8 @@ cast_to = Vector2( 21, 0 )
collision_mask = 2
[node name="Hitbox_Component" type="Area2D" parent="." index="8"]
collision_layer = 128
collision_mask = 0
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox_Component" index="0"]
modulate = Color( 1, 0.596078, 0.121569, 1 )

View File

@ -13,7 +13,7 @@ func process_physics(delta):
stop()
return
if player_detector.is_colliding():
print(owner.name, " wants to attack")
#print(owner.name, " wants to attack")
stop()
wants_to_attack = true
return

View File

@ -33,4 +33,5 @@ func shoot_projectile():
#func play_sound():
# sound_effects.stream = "res://assets/Sounds/crappy pew.wav"
func gotcha():
print("oh! You got me.")

View File

@ -509,6 +509,8 @@ timeout_seconds = 2.0
animation_suffix = true
[node name="Hurtbox_Component" parent="." instance=ExtResource( 12 )]
collision_layer = 0
collision_mask = 128
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hurtbox_Component"]
modulate = Color( 1, 0, 0, 1 )