diff --git a/DungeonShooting_Godot/resource/map/tileMaps/GroupConfig.json b/DungeonShooting_Godot/resource/map/tileMaps/GroupConfig.json index 284191c..a26cac1 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/GroupConfig.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/GroupConfig.json @@ -7,6 +7,12 @@ "RoomPath": "resource/map/tileMaps/TestGroup1/battle/Room1/Room1_roomInfo.json", "TilePath": "resource/map/tileMaps/TestGroup1/battle/Room1/Room1_tileInfo.json", "PreinstallPath": "resource/map/tileMaps/TestGroup1/battle/Room1/Room1_preinstall.json" + }, + { + "Ready": true, + "RoomPath": "resource/map/tileMaps/TestGroup1/battle/Room2/Room2_roomInfo.json", + "TilePath": "resource/map/tileMaps/TestGroup1/battle/Room2/Room2_tileInfo.json", + "PreinstallPath": "resource/map/tileMaps/TestGroup1/battle/Room2/Room2_preinstall.json" } ], "InletList": [ diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room2/Room2_preinstall.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room2/Room2_preinstall.json new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room2/Room2_preinstall.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room2/Room2_roomInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room2/Room2_roomInfo.json new file mode 100644 index 0000000..ed74cc0 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room2/Room2_roomInfo.json @@ -0,0 +1 @@ +{"Position":{"X":-12,"Y":-8},"Size":{"X":22,"Y":17},"DoorAreaInfos":[{"Direction":3,"Start":0,"End":320},{"Direction":0,"Start":0,"End":240},{"Direction":2,"Start":0,"End":320},{"Direction":1,"Start":0,"End":240}],"GroupName":"TestGroup1","RoomType":0,"RoomName":"Room2","Weight":100,"Remark":""} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room2/Room2_tileInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room2/Room2_tileInfo.json new file mode 100644 index 0000000..b66e671 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room2/Room2_tileInfo.json @@ -0,0 +1 @@ +{"NavigationList":[{"Type":0,"Points":[-168,-104,136,-104,136,128,-168,128]},{"Type":1,"Points":[-120,-48,-24,-48,-24,8,-120,8]},{"Type":1,"Points":[-8,48,104,48,104,104,-8,104]}],"Floor":[-11,-7,0,0,8,-11,-6,0,0,8,-11,-5,0,0,8,-11,-4,0,0,8,-11,-3,0,0,8,-11,-2,0,0,8,-11,-1,0,0,8,-11,0,0,0,8,-11,1,0,0,8,-11,2,0,0,8,-11,3,0,0,8,-11,4,0,0,8,-11,5,0,0,8,-11,6,0,0,8,-11,7,0,0,8,-10,-7,0,0,8,-10,-6,0,0,8,-10,-5,0,0,8,-10,-4,0,0,8,-10,-3,0,0,8,-10,-2,0,0,8,-10,-1,0,0,8,-10,0,0,0,8,-10,1,0,0,8,-10,2,0,0,8,-10,3,0,0,8,-10,4,0,0,8,-10,5,0,0,8,-10,6,0,0,8,-10,7,0,0,8,-9,-7,0,0,8,-9,-6,0,0,8,-9,-5,0,0,8,-9,-4,0,0,8,-9,-3,0,0,8,-9,-2,0,0,8,-9,-1,0,0,8,-9,0,0,0,8,-9,1,0,0,8,-9,2,0,0,8,-9,3,0,0,8,-9,4,0,0,8,-9,5,0,0,8,-9,6,0,0,8,-9,7,0,0,8,-8,-7,0,0,8,-8,-6,0,0,8,-8,-5,0,0,8,-8,-4,0,0,8,-8,-3,0,0,8,-8,-2,0,0,8,-8,-1,0,0,8,-8,0,0,0,8,-8,1,0,0,8,-8,2,0,0,8,-8,3,0,0,8,-8,4,0,0,8,-8,5,0,0,8,-8,6,0,0,8,-8,7,0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2,2,3,0,2,2,2,8,0,2,2,3,3,0,2,2,3,8,0,2,2,4,3,0,2,2,4,8,0,2,2,5,3,0,3,2,5,4,0,3,3,5,8,0,2,2,6,8,0,2,2,7,8,0,2,2,8,8,0,2,2,9,-8,0,1,4,9,-7,0,1,3,9,-6,0,1,3,9,-5,0,1,3,9,-4,0,1,3,9,-3,0,1,3,9,-2,0,1,3,9,-1,0,1,3,9,0,0,1,3,9,1,0,1,3,9,2,0,1,3,9,3,0,1,3,9,4,0,1,3,9,5,0,1,3,9,6,0,1,3,9,7,0,1,3,9,8,0,13,2]} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001.png.import b/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001.png.import index 5dc61b5..7e5d2de 100644 --- a/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001.png.import +++ b/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://ddhkhfaos2w1g" -path="res://.godot/imported/enemy0001.png-1247a3ddf8a1a163d812cad12c4340fd.ctex" +path="res://.godot/imported/Enemy0001.png-148a38dfa95953b26d890356e8875de4.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://resource/sprite/role/enemy0001/enemy0001.png" -dest_files=["res://.godot/imported/enemy0001.png-1247a3ddf8a1a163d812cad12c4340fd.ctex"] +source_file="res://resource/sprite/role/enemy0001/Enemy0001.png" +dest_files=["res://.godot/imported/Enemy0001.png-148a38dfa95953b26d890356e8875de4.ctex"] [params] diff --git a/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001_Debris.png.import b/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001_Debris.png.import index 2f4c450..aa89659 100644 --- a/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001_Debris.png.import +++ b/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001_Debris.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://cn64eauvwx1uj" -path="res://.godot/imported/enemy0001_Debris.png-297a2fb6680cb862a9a085cf58f8268c.ctex" +path="res://.godot/imported/Enemy0001_Debris.png-ac416dc79cd3c1217b27e1ef1fbe0d0b.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://resource/sprite/role/enemy0001/enemy0001_Debris.png" -dest_files=["res://.godot/imported/enemy0001_Debris.png-297a2fb6680cb862a9a085cf58f8268c.ctex"] +source_file="res://resource/sprite/role/enemy0001/Enemy0001_Debris.png" +dest_files=["res://.godot/imported/Enemy0001_Debris.png-ac416dc79cd3c1217b27e1ef1fbe0d0b.ctex"] [params] diff --git a/DungeonShooting_Godot/scene/Main.tscn b/DungeonShooting_Godot/scene/Main.tscn index b034a25..d31de2b 100644 --- a/DungeonShooting_Godot/scene/Main.tscn +++ b/DungeonShooting_Godot/scene/Main.tscn @@ -26,6 +26,7 @@ SubViewportContainer = NodePath("ViewCanvas/SubViewportContainer") SceneRoot = NodePath("ViewCanvas/SubViewportContainer/SubViewport/SceneRoot") GlobalNodeRoot = NodePath("GlobalNodeRoot") +Debug = true metadata/_edit_vertical_guides_ = [] [node name="ViewCanvas" type="CanvasLayer" parent="."] diff --git a/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs b/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs index 4fded36..bc9133e 100644 --- a/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs +++ b/DungeonShooting_Godot/src/framework/map/DungeonTileMap.cs @@ -72,9 +72,9 @@ } else { - var rectSize = roomInfo.RoomSplit.RoomInfo.Size; - var rectPos = roomInfo.RoomSplit.RoomInfo.Position; - var offset = roomInfo.GetOffsetPosition() / GameConfig.TileCellSizeVector2I; + //var rectSize = roomInfo.RoomSplit.RoomInfo.Size; + var rectPos = roomInfo.RoomSplit.RoomInfo.Position.AsVector2I(); + //var offset = roomInfo.GetOffsetPosition() / GameConfig.TileCellSizeVector2I; //填充tile操作 var tileInfo = roomInfo.RoomSplit.TileInfo; for (var i = 0; i < tileInfo.Floor.Count; i += 5) @@ -84,7 +84,7 @@ var sourceId = tileInfo.Floor[i + 2]; var atlasCoordsX = tileInfo.Floor[i + 3]; var atlasCoordsY = tileInfo.Floor[i + 4]; - var pos = new Vector2I(roomInfo.Position.X + posX - offset.X, roomInfo.Position.Y + posY - offset.Y); + var pos = new Vector2I(roomInfo.Position.X + posX - rectPos.X, roomInfo.Position.Y + posY - rectPos.Y); _tileRoot.SetCell(GameConfig.FloorMapLayer, pos, sourceId, new Vector2I(atlasCoordsX, atlasCoordsY)); } for (var i = 0; i < tileInfo.Middle.Count; i += 5) @@ -94,7 +94,7 @@ var sourceId = tileInfo.Middle[i + 2]; var atlasCoordsX = tileInfo.Middle[i + 3]; var atlasCoordsY = tileInfo.Middle[i + 4]; - var pos = new Vector2I(roomInfo.Position.X + posX - offset.X, roomInfo.Position.Y + posY - offset.Y); + var pos = new Vector2I(roomInfo.Position.X + posX - rectPos.X, roomInfo.Position.Y + posY - rectPos.Y); _tileRoot.SetCell(GameConfig.MiddleMapLayer, pos, sourceId, new Vector2I(atlasCoordsX, atlasCoordsY)); } for (var i = 0; i < tileInfo.Top.Count; i += 5) @@ -104,7 +104,7 @@ var sourceId = tileInfo.Top[i + 2]; var atlasCoordsX = tileInfo.Top[i + 3]; var atlasCoordsY = tileInfo.Top[i + 4]; - var pos = new Vector2I(roomInfo.Position.X + posX - offset.X, roomInfo.Position.Y + posY - offset.Y); + var pos = new Vector2I(roomInfo.Position.X + posX - rectPos.X, roomInfo.Position.Y + posY - rectPos.Y); _tileRoot.SetCell(GameConfig.TopMapLayer, pos, sourceId, new Vector2I(atlasCoordsX, atlasCoordsY)); } diff --git a/DungeonShooting_Godot/src/game/activity/role/Player.cs b/DungeonShooting_Godot/src/game/activity/role/Player.cs index 7cb4330..565dc02 100644 --- a/DungeonShooting_Godot/src/game/activity/role/Player.cs +++ b/DungeonShooting_Godot/src/game/activity/role/Player.cs @@ -36,12 +36,12 @@ Shield = 0; // debug用 - // Acceleration = 3000; - // Friction = 3000; - // MoveSpeed = 500; - // CollisionLayer = 0; - // CollisionMask = 0; - // GameCamera.Main.Zoom = new Vector2(0.5f, 0.5f); + RoleState.Acceleration = 3000; + RoleState.Friction = 3000; + RoleState.MoveSpeed = 500; + CollisionLayer = 0; + CollisionMask = 0; + GameCamera.Main.Zoom = new Vector2(0.5f, 0.5f); } protected override void Process(float delta) diff --git a/DungeonShooting_Godot/src/game/room/DungeonManager.cs b/DungeonShooting_Godot/src/game/room/DungeonManager.cs index da2f8b5..b4891c1 100644 --- a/DungeonShooting_Godot/src/game/room/DungeonManager.cs +++ b/DungeonShooting_Godot/src/game/room/DungeonManager.cs @@ -232,11 +232,12 @@ for (var i = 0; i < polygonArray.Count; i++) { var navigationPolygonData = polygonArray[i]; - var polygonPointArray = navigationPolygonData.GetPoints(); + var tempPosArray = navigationPolygonData.GetPoints(); + var polygonPointArray = new Vector2[tempPosArray.Length]; //这里的位置需要加上房间位置 - for (var j = 0; j < polygonPointArray.Length; j++) + for (var j = 0; j < tempPosArray.Length; j++) { - polygonPointArray[j] = polygonPointArray[j] + roomInfo.GetWorldPosition() - offset; + polygonPointArray[j] = tempPosArray[j] + roomInfo.GetWorldPosition() - offset; } polygon.AddOutline(polygonPointArray);