Kinda have a working hit/hurtbox model again.
This commit is contained in:
parent
81d765e952
commit
225e42957f
|
|
@ -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"]
|
||||
|
|
|
|||
|
|
@ -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 )
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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.")
|
||||
|
|
|
|||
|
|
@ -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 )
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user