1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-11 14:17:13 +08:00

feat(障碍物系统): 添加草墙障碍物及相关功能

实现草墙障碍物系统,包括以下主要变更:
- 新增草墙障碍物资源、脚本和场景
- 添加障碍物状态显示UI
- 扩展组件管理器支持障碍物类型
- 修改子弹系统以支持对障碍物的碰撞检测
- 调整实体碰撞层设置
- 为公鸡角色添加草墙武器

新增功能允许玩家放置可阻挡敌人的草墙障碍物,并显示其生命值状态
This commit is contained in:
2026-01-27 20:52:26 +08:00
parent 2f2a3fd04b
commit 3698127345
22 changed files with 400 additions and 18 deletions
-1
View File
@@ -347,7 +347,6 @@ alpha_curve = SubResource("CurveTexture_vvfxd")
[sub_resource type="CircleShape2D" id="CircleShape2D_34h7q"]
[node name="EntityBase" type="CharacterBody2D"]
collision_layer = 0
script = ExtResource("1_mvol6")
[node name="syncer" type="MultiplayerSynchronizer" parent="."]
+40
View File
@@ -0,0 +1,40 @@
[gd_scene load_steps=6 format=3 uid="uid://dwydudqawsiqi"]
[ext_resource type="Texture2D" uid="uid://dwwpkn4q07ja2" path="res://icon.svg" id="1_4helc"]
[ext_resource type="Script" uid="uid://bj26s4i47bw0a" path="res://scripts/Statemachine/ObstacleBase.gd" id="1_b4dgm"]
[ext_resource type="PackedScene" uid="uid://copkyentuuxpt" path="res://components/UI/ObstacleStateBar.tscn" id="3_esd5c"]
[sub_resource type="SpriteFrames" id="SpriteFrames_b4dgm"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("1_4helc")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[sub_resource type="CircleShape2D" id="CircleShape2D_1gjhb"]
radius = 70.00714
[node name="ObstacleBase" type="StaticBody2D"]
script = ExtResource("1_b4dgm")
healthMax = null
penerateResistance = null
blockPlayer = null
blockEnemy = null
[node name="texture" type="AnimatedSprite2D" parent="."]
unique_name_in_owner = true
sprite_frames = SubResource("SpriteFrames_b4dgm")
[node name="statebar" parent="texture" node_paths=PackedStringArray("obstacle") instance=ExtResource("3_esd5c")]
unique_name_in_owner = true
position = Vector2(0, -86)
obstacle = NodePath("../..")
[node name="hitbox" type="CollisionShape2D" parent="."]
unique_name_in_owner = true
shape = SubResource("CircleShape2D_1gjhb")
debug_color = Color(1, 0.09928554, 0, 0.41960785)