Player can die now

This commit is contained in:
MaddoScientisto 2024-08-18 17:38:32 +02:00
commit 360b4dfe6a
6 changed files with 87 additions and 24 deletions

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=26 format=3 uid="uid://bghghp5ep4w2j"]
[gd_scene load_steps=27 format=3 uid="uid://bghghp5ep4w2j"]
[ext_resource type="Script" path="res://Scripts/PlayerMovement.cs" id="1_m27vu"]
[ext_resource type="Texture2D" uid="uid://la06powu57hu" path="res://Sprites/Cirno_Big.png" id="2_bwf6x"]
@ -138,7 +138,10 @@ animations = [{
[sub_resource type="CircleShape2D" id="CircleShape2D_oevaq"]
radius = 17.2627
[node name="Player" type="CharacterBody2D" node_paths=PackedStringArray("Muzzle") groups=["player"]]
[sub_resource type="CircleShape2D" id="CircleShape2D_e6woi"]
radius = 1.41421
[node name="Player" type="CharacterBody2D" node_paths=PackedStringArray("Muzzle") groups=["Destroyable", "player"]]
collision_layer = 2
collision_mask = 99
script = ExtResource("1_m27vu")
@ -147,6 +150,8 @@ CrosshairDistance = 20.0
BulletScene = ExtResource("2_ov36d")
SelectorScene = ExtResource("3_8wt6s")
Muzzle = NodePath("Muzzle")
Health = 32.0
RateOfFire = 0.1
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
@ -188,4 +193,16 @@ script = ExtResource("7_uvgjg")
[node name="CollisionShape2D" type="CollisionShape2D" parent="InteractionController"]
shape = SubResource("CircleShape2D_oevaq")
[node name="ShootTimer" type="Timer" parent="."]
one_shot = true
[node name="DamageHitBox" type="Area2D" parent="."]
collision_layer = 2
collision_mask = 128
[node name="CollisionShape2D" type="CollisionShape2D" parent="DamageHitBox"]
shape = SubResource("CircleShape2D_e6woi")
debug_color = Color(1, 0.00817797, 0.0443347, 0.42)
[connection signal="area_entered" from="InteractionController" to="." method="_on_interaction_controller_area_entered"]
[connection signal="area_entered" from="DamageHitBox" to="." method="_on_damage_hit_box_area_entered"]