player can now be killed by death tiles directly

This commit is contained in:
pennyrigate 2023-02-07 00:20:56 -05:00
parent 9552fee802
commit 89671b3ca9
3 changed files with 18 additions and 3 deletions

View file

@ -354,3 +354,6 @@ func _on_SwordArea_area_entered(area):
return
else:
target.die()
func _on_Area2D_body_entered(body):
if body.is_in_group("death"): die()

View file

@ -628,6 +628,7 @@ region_rect = Rect2( 0, 0, 32, 32 )
[node name="Area2D" type="Area2D" parent="." groups=["player"]]
position = Vector2( 0, 3 )
collision_layer = 9
collision_mask = 33
[node name="CollisionShape2D2" type="CollisionShape2D" parent="Area2D"]
position = Vector2( 0.5, 2 )
@ -710,5 +711,6 @@ scale_amount = 0.25
scale_amount_random = 0.5
scale_amount_curve = SubResource( 43 )
[connection signal="body_entered" from="Area2D" to="." method="_on_Area2D_body_entered"]
[connection signal="animation_finished" from="AnimationPlayer" to="." method="_on_AnimationPlayer_animation_finished"]
[connection signal="area_entered" from="SwordArea" to="." method="_on_SwordArea_area_entered"]