feat: 添加Hitbox和Hurtbox,添加敌人和玩家之间的碰撞
This commit is contained in:
@@ -11,7 +11,10 @@ _data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0]
|
||||
point_count = 2
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_etcc1"]
|
||||
radius = 30.0
|
||||
radius = 2.236068
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_ht2l1"]
|
||||
radius = 33.0
|
||||
|
||||
[node name="PlayerWellRounded" unique_id=2022554550 instance=ExtResource("1_wkafa")]
|
||||
collision_mask = 2
|
||||
@@ -38,7 +41,7 @@ z_index = 1
|
||||
texture = ExtResource("2_etcc1")
|
||||
|
||||
[node name="CollisionShape2D" parent="." index="1" unique_id=139786467]
|
||||
visible = false
|
||||
z_index = 1
|
||||
position = Vector2(0, -31)
|
||||
shape = SubResource("CircleShape2D_etcc1")
|
||||
|
||||
@@ -51,5 +54,14 @@ one_shot = true
|
||||
[node name="TrailTimer" type="Timer" parent="." index="5" unique_id=2006934730]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="HurtboxComponent" parent="." index="6" unique_id=1155790880]
|
||||
collision_layer = 32
|
||||
collision_mask = 4
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="HurtboxComponent" index="0" unique_id=1411044109]
|
||||
z_index = 1
|
||||
position = Vector2(0, -32)
|
||||
shape = SubResource("CircleShape2D_ht2l1")
|
||||
|
||||
[connection signal="timeout" from="DashTimer" to="." method="_on_dash_timer_timeout"]
|
||||
[connection signal="timeout" from="TrailTimer" to="Visuals/Trail" method="_on_trail_timer_timeout"]
|
||||
|
||||
Reference in New Issue
Block a user