diff --git a/DungeonShooting_Godot/prefab/map/RoomDoor_E.tscn b/DungeonShooting_Godot/prefab/map/RoomDoor_E.tscn index 2631c7c..7f97af2 100644 --- a/DungeonShooting_Godot/prefab/map/RoomDoor_E.tscn +++ b/DungeonShooting_Godot/prefab/map/RoomDoor_E.tscn @@ -15,6 +15,7 @@ shader_parameter/outline_color = Color(0, 0, 0, 1) shader_parameter/outline_rainbow = false shader_parameter/outline_use_blend = true +shader_parameter/grey = 0.0 [sub_resource type="ShaderMaterial" id="ShaderMaterial_t4ayq"] resource_local_to_scene = true @@ -26,6 +27,7 @@ shader_parameter/outline_color = Color(0, 0, 0, 1) shader_parameter/outline_rainbow = false shader_parameter/outline_use_blend = true +shader_parameter/grey = 0.0 [sub_resource type="RectangleShape2D" id="RectangleShape2D_opsb6"] resource_local_to_scene = true diff --git a/DungeonShooting_Godot/prefab/map/RoomDoor_W.tscn b/DungeonShooting_Godot/prefab/map/RoomDoor_W.tscn index 727c632..f401bfb 100644 --- a/DungeonShooting_Godot/prefab/map/RoomDoor_W.tscn +++ b/DungeonShooting_Godot/prefab/map/RoomDoor_W.tscn @@ -15,6 +15,7 @@ shader_parameter/outline_color = Color(0, 0, 0, 1) shader_parameter/outline_rainbow = false shader_parameter/outline_use_blend = true +shader_parameter/grey = 0.0 [sub_resource type="ShaderMaterial" id="ShaderMaterial_t4ayq"] resource_local_to_scene = true @@ -26,6 +27,7 @@ shader_parameter/outline_color = Color(0, 0, 0, 1) shader_parameter/outline_rainbow = false shader_parameter/outline_use_blend = true +shader_parameter/grey = 0.0 [sub_resource type="RectangleShape2D" id="RectangleShape2D_2ko2r"] resource_local_to_scene = true diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup2/inlet/Start1/Preinstall.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup2/inlet/Start1/Preinstall.json index 65cf45e..c68df53 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup2/inlet/Start1/Preinstall.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup2/inlet/Start1/Preinstall.json @@ -1 +1 @@ -[{"Name":"Preinstall1","Weight":100,"Remark":"","WaveList":[[{"Position":{"X":29,"Y":13},"Size":{"X":21,"Y":14},"SpecialMarkType":1,"DelayTime":0,"MarkList":[]},{"Position":{"X":33,"Y":33},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0002","Weight":100,"Attr":{"CurrAmmon":"7","ResidueAmmo":"70"},"Altitude":8,"VerticalSpeed":0}]}]]}] \ No newline at end of file +[{"Name":"Preinstall1","Weight":100,"Remark":"","WaveList":[[{"Position":{"X":29,"Y":13},"Size":{"X":21,"Y":14},"SpecialMarkType":1,"DelayTime":0,"MarkList":[]},{"Position":{"X":33,"Y":33},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0002","Weight":100,"Attr":{"CurrAmmon":"7","ResidueAmmo":"70"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":58,"Y":29},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0009","Weight":100,"Attr":{"CurrAmmon":"1","ResidueAmmo":"25"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":28,"Y":56},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0007","Weight":100,"Attr":{"CurrAmmon":"60","ResidueAmmo":"300"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":53,"Y":57},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0008","Weight":100,"Attr":{"CurrAmmon":"10","ResidueAmmo":"120"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":79,"Y":46},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0009","Weight":100,"Attr":{"CurrAmmon":"1","ResidueAmmo":"25"},"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":74,"Y":27},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0010","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]},{"Position":{"X":62,"Y":7},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"prop0011","Weight":100,"Attr":null,"Altitude":8,"VerticalSpeed":0}]}]]}] \ No newline at end of file diff --git a/DungeonShooting_Godot/scene/test/TestNewTerrain.tscn b/DungeonShooting_Godot/scene/test/TestNewTerrain.tscn index 0d74fb7..0309654 100644 --- a/DungeonShooting_Godot/scene/test/TestNewTerrain.tscn +++ b/DungeonShooting_Godot/scene/test/TestNewTerrain.tscn @@ -1,9 +1,10 @@ -[gd_scene load_steps=6 format=3 uid="uid://iwm27vpirfef"] +[gd_scene load_steps=7 format=3 uid="uid://iwm27vpirfef"] [ext_resource type="Script" path="res://src/test/TestNewTerrain.cs" id="1_68mbo"] [ext_resource type="TileSet" uid="uid://cu80e6kxc3c3x" path="res://resource/tileSet/map2/TileSet2.tres" id="1_ig8lo"] [ext_resource type="PackedScene" uid="uid://cxhrcytrx0kcf" path="res://prefab/role/Role0001.tscn" id="3_bo13a"] [ext_resource type="Shader" path="res://resource/material/Blend.gdshader" id="4_iy0ux"] +[ext_resource type="Texture2D" uid="uid://bda63puujv425" path="res://resource/sprite/role/common/Role_query.png" id="5_rv0km"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_7va3f"] resource_local_to_scene = true @@ -44,7 +45,7 @@ y_sort_enabled = true [node name="Role0001" parent="TileMap2/NormalLayer" node_paths=PackedStringArray("HurtArea", "HurtCollision", "InteractiveArea", "InteractiveCollision", "TipRoot", "TipSprite", "AnimationPlayer", "MountPoint", "BackMountPoint", "MeleeAttackArea", "MeleeAttackCollision", "ShadowSprite", "AnimatedSprite", "Collision") instance=ExtResource("3_bo13a")] -position = Vector2(131, 62.5) +position = Vector2(125.5, 64) HurtArea = NodePath("../../YSortLayer/Role0001/HurtArea") HurtCollision = NodePath("../../YSortLayer/Role0001/HurtArea/HurtCollision") InteractiveArea = NodePath("../../YSortLayer/Role0001/InteractiveArea") @@ -76,10 +77,9 @@ [node name="YSortLayer" type="Node2D" parent="TileMap2"] y_sort_enabled = true -position = Vector2(9, 5) [node name="Role0001" parent="TileMap2/YSortLayer" instance=ExtResource("3_bo13a")] -position = Vector2(130, 47.5) +position = Vector2(145, 55) metadata/_edit_group_ = true [node name="AnimatedSprite" parent="TileMap2/YSortLayer/Role0001" index="2"] @@ -95,5 +95,10 @@ [node name="InteractiveArea" parent="TileMap2/YSortLayer/Role0001" index="5"] visible = false +[node name="Sprite2D" type="Sprite2D" parent="TileMap2/YSortLayer"] +z_index = 1 +position = Vector2(103, 32.5) +texture = ExtResource("5_rv0km") + [editable path="TileMap2/NormalLayer/Role0001"] [editable path="TileMap2/YSortLayer/Role0001"] diff --git a/DungeonShooting_Godot/src/game/activity/bullet/laser/Laser.cs b/DungeonShooting_Godot/src/game/activity/bullet/laser/Laser.cs index 785f4a8..de08f5b 100644 --- a/DungeonShooting_Godot/src/game/activity/bullet/laser/Laser.cs +++ b/DungeonShooting_Godot/src/game/activity/bullet/laser/Laser.cs @@ -68,7 +68,8 @@ _init = true; } - + + ZIndex = 1; BulletData = data; AttackLayer = attackLayer; @@ -77,7 +78,7 @@ //计算射线最大距离, 也就是撞到墙壁的距离 var targetPosition = data.Position + Vector2.FromAngle(data.Rotation) * data.MaxDistance; - var parameters = PhysicsRayQueryParameters2D.Create(data.Position, targetPosition, PhysicsLayer.Wall); + var parameters = PhysicsRayQueryParameters2D.Create(data.Position + new Vector2(0, data.Altitude), targetPosition + new Vector2(0, data.Altitude), PhysicsLayer.Wall); var result = GetWorld2D().DirectSpaceState.IntersectRay(parameters); float distance; var doRebound = false; //是否需要执行反弹 @@ -86,7 +87,7 @@ if (result != null && result.TryGetValue("position", out var point)) //撞到墙壁 { doRebound = true; - reboundPosition = (Vector2)point; + reboundPosition = (Vector2)point - new Vector2(0, data.Altitude); reboundNormal = (Vector2)result["normal"]; distance = Position.DistanceTo(reboundPosition.Value); } diff --git a/DungeonShooting_Godot/src/game/activity/bullet/normal/Bullet.cs b/DungeonShooting_Godot/src/game/activity/bullet/normal/Bullet.cs index bf0a0dc..7741652 100644 --- a/DungeonShooting_Godot/src/game/activity/bullet/normal/Bullet.cs +++ b/DungeonShooting_Godot/src/game/activity/bullet/normal/Bullet.cs @@ -259,7 +259,7 @@ /// - /// 播放子弹消失特效 + /// 播放子弹撞墙消失特效 /// public void PlayCollisionEffect(KinematicCollision2D collision, string path) { diff --git a/DungeonShooting_Godot/src/game/effects/AutoDestroyParticles.cs b/DungeonShooting_Godot/src/game/effects/AutoDestroyParticles.cs index c05b1c4..efffc2f 100644 --- a/DungeonShooting_Godot/src/game/effects/AutoDestroyParticles.cs +++ b/DungeonShooting_Godot/src/game/effects/AutoDestroyParticles.cs @@ -28,6 +28,7 @@ public virtual void PlayEffect() { + ZIndex = 1; Emitting = true; Restart(); if (Particles2D != null) diff --git a/DungeonShooting_Godot/src/game/effects/AutoDestroySprite.cs b/DungeonShooting_Godot/src/game/effects/AutoDestroySprite.cs index 7dd66e6..04ae923 100644 --- a/DungeonShooting_Godot/src/game/effects/AutoDestroySprite.cs +++ b/DungeonShooting_Godot/src/game/effects/AutoDestroySprite.cs @@ -33,6 +33,7 @@ public virtual void PlayEffect() { + ZIndex = 1; if (Particles2D != null) { foreach (var gpuParticles2D in Particles2D)