diff --git a/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs b/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs index f3f045a..f73673d 100644 --- a/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs +++ b/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs @@ -50,11 +50,11 @@ private int _roomMaxInterval = 5; //房间横轴分散程度 - private float _roomHorizontalMinDispersion = 0f; + private float _roomHorizontalMinDispersion = -3f; private float _roomHorizontalMaxDispersion = 3f; //房间纵轴分散程度 - private float _roomVerticalMinDispersion = 0f; + private float _roomVerticalMinDispersion = -3f; private float _roomVerticalMaxDispersion = 3f; //区域限制 @@ -349,6 +349,7 @@ } for (; tryCount < maxTryCount; tryCount++) { + //下一个房间方向 var direction = _random.RandomRangeInt(0, 3); //房间间隔 var space = _random.RandomRangeInt(_roomMinInterval, _roomMaxInterval); @@ -360,12 +361,12 @@ int offset; if (direction == 0 || direction == 2) { - offset = _random.RandomRangeInt(-(int)(prevRoomInfo.Size.X * _roomVerticalMinDispersion), + offset = _random.RandomRangeInt((int)(prevRoomInfo.Size.X * _roomVerticalMinDispersion), (int)(prevRoomInfo.Size.X * _roomVerticalMaxDispersion)); } else { - offset = _random.RandomRangeInt(-(int)(prevRoomInfo.Size.Y * _roomHorizontalMinDispersion), + offset = _random.RandomRangeInt((int)(prevRoomInfo.Size.Y * _roomHorizontalMinDispersion), (int)(prevRoomInfo.Size.Y * _roomHorizontalMaxDispersion)); } @@ -743,6 +744,7 @@ } else { + return false; if (_random.RandomBoolean()) //↓ //→ { if (!TryConnect_SE_Door(roomInfo, nextRoomInfo, roomDoor, nextRoomDoor, ref cross) && @@ -763,6 +765,7 @@ } else { + return false; if (roomInfo.GetVerticalStart() > nextRoomInfo.GetVerticalStart()) //→ //↓ { if (_random.RandomBoolean()) diff --git a/DungeonShooting_Godot/src/game/GameApplication.cs b/DungeonShooting_Godot/src/game/GameApplication.cs index 9449bc1..ce2c7f5 100644 --- a/DungeonShooting_Godot/src/game/GameApplication.cs +++ b/DungeonShooting_Godot/src/game/GameApplication.cs @@ -110,7 +110,7 @@ //固定帧率 Engine.MaxFps = TargetFps; //调试绘制开关 - ActivityObject.IsDebug = false; + ActivityObject.IsDebug = true; //Engine.TimeScale = 0.2f; //调整窗口分辨率 OnWindowSizeChanged(); diff --git a/DungeonShooting_Godot/src/game/room/DungeonManager.cs b/DungeonShooting_Godot/src/game/room/DungeonManager.cs index 3d53ee1..551210f 100644 --- a/DungeonShooting_Godot/src/game/room/DungeonManager.cs +++ b/DungeonShooting_Godot/src/game/room/DungeonManager.cs @@ -547,14 +547,16 @@ } else //←↓ { - + calcRect.Position += new Vector2I(0, 3); + calcRect.Size -= new Vector2I(2, 3); } } else if (roomDoorInfo.Direction == DoorDirection.N) { if (roomDoorInfo.ConnectDoor.Direction == DoorDirection.E) //↑→ { - + calcRect.Position += new Vector2I(2, -1); + calcRect.Size -= new Vector2I(2, 1); } else //↑← {