diff --git a/DungeonShooting_Godot/resource/tileSprite/map2/Dungeon Tileset + Spikes.png b/DungeonShooting_Godot/resource/tileSprite/map2/Dungeon Tileset + Spikes.png new file mode 100644 index 0000000..b94b19d --- /dev/null +++ b/DungeonShooting_Godot/resource/tileSprite/map2/Dungeon Tileset + Spikes.png Binary files differ diff --git a/DungeonShooting_Godot/resource/tileSprite/map2/Dungeon Tileset + Spikes.png.import b/DungeonShooting_Godot/resource/tileSprite/map2/Dungeon Tileset + Spikes.png.import new file mode 100644 index 0000000..847285b --- /dev/null +++ b/DungeonShooting_Godot/resource/tileSprite/map2/Dungeon Tileset + Spikes.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bwp887tjcbwfg" +path="res://.godot/imported/Dungeon Tileset + Spikes.png-7a50fdc30ac0353a216568c349db821f.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/tileSprite/map2/Dungeon Tileset + Spikes.png" +dest_files=["res://.godot/imported/Dungeon Tileset + Spikes.png-7a50fdc30ac0353a216568c349db821f.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/DungeonShooting_Godot/scene/test/TestNewTerrain.tscn b/DungeonShooting_Godot/scene/test/TestNewTerrain.tscn new file mode 100644 index 0000000..a07a8d5 --- /dev/null +++ b/DungeonShooting_Godot/scene/test/TestNewTerrain.tscn @@ -0,0 +1,159 @@ +[gd_scene load_steps=4 format=3 uid="uid://iwm27vpirfef"] + +[ext_resource type="Texture2D" uid="uid://bwp887tjcbwfg" path="res://resource/tileSprite/map2/Dungeon Tileset + Spikes.png" id="1_b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:6/0 = 0 +10:6/0 = 0 +11:6/0 = 0 +12:6/0 = 0 +0:7/0 = 0 +1:7/0 = 0 +2:7/0 = 0 +3:7/0 = 0 +4:7/0 = 0 +5:7/0 = 0 +6:7/0 = 0 +7:7/0 = 0 +8:7/0 = 0 +9:7/0 = 0 +10:7/0 = 0 +11:7/0 = 0 +12:7/0 = 0 +0:8/0 = 0 +1:8/0 = 0 +2:8/0 = 0 +3:8/0 = 0 +4:8/0 = 0 +5:8/0 = 0 +6:8/0 = 0 +7:8/0 = 0 +8:8/0 = 0 +9:8/0 = 0 +10:8/0 = 0 +11:8/0 = 0 +12:8/0 = 0 +0:9/0 = 0 +1:9/0 = 0 +2:9/0 = 0 +3:9/0 = 0 +4:9/0 = 0 +5:9/0 = 0 +6:9/0 = 0 +7:9/0 = 0 +8:9/0 = 0 +9:9/0 = 0 +10:9/0 = 0 +11:9/0 = 0 +12:9/0 = 0 +0:10/0 = 0 +1:10/0 = 0 +2:10/0 = 0 +3:10/0 = 0 +4:10/0 = 0 +5:10/0 = 0 +6:10/0 = 0 +7:10/0 = 0 +8:10/0 = 0 +9:10/0 = 0 +10:10/0 = 0 +11:10/0 = 0 +12:10/0 = 0 + +[sub_resource type="TileSet" id="TileSet_x73rk"] +sources/0 = SubResource("TileSetAtlasSource_u8qd0") + +[node name="TestNewTerrain" type="Node2D"] + +[node name="TileMap" type="TileMap" parent="."] +tile_set = SubResource("TileSet_x73rk") +format = 2 +layer_0/tile_data = PackedInt32Array(-65535, 327680, 3, -65536, 327680, 3, 0, 393216, 3, 1, 327680, 3, 65537, 327680, 3, 65536, 327680, 3, 131073, 327680, 3, 131072, 327680, 3, 196608, 327680, 7, 196609, 327680, 7, 262145, 327680, 7, 262144, 327680, 7, 65535, 327680, 3, 131071, 327680, 3, 2, 327680, 3, 65538, 327680, 3, 327679, 327680, 3, 393215, 327680, 3, 327680, 327680, 3, 327681, 327680, 3, 327682, 327680, 3, 262146, 327680, 3, 5, 327680, 3, 65541, 327680, 3, 131077, 327680, 3, 196613, 327680, 3, 262149, 327680, 3, 327685, 327680, 3, 327686, 327680, 3, 327687, 327680, 3, 327688, 327680, 3, 262152, 327680, 3, 262153, 327680, 3, 327689, 327680, 3, 262154, 327680, 3, 196618, 327680, 3, 131082, 327680, 3, 65546, 327680, 3, 10, 327680, 3, 9, 327680, 3, 8, 327680, 3, 7, 327680, 3, 6, 327680, 3, 327690, 327680, 3, 262151, 327680, 3, 262150, 327680, 3, 196614, 327680, 3, 131078, 327680, 3, 65542, 327680, 3, 65543, 327680, 3, 65544, 327680, 3, 65545, 327680, 3, 131081, 327680, 3, 196617, 327680, 3, -65531, 262144, 1, -65530, 327680, 1, -65528, 327680, 1, -65527, 262144, 1, -65529, 262144, 1, -65526, 327680, 1, -131061, 720896, 1, -65525, 720896, 2, 11, 720896, 2, 65547, 720896, 2, 131083, 720896, 2, 196619, 720896, 2, 262155, 720896, 2, 327691, 720896, 2, 393227, 720896, 4, 393221, 655360, 4, 393222, 655360, 4, 393223, 655360, 4, 393224, 655360, 4, 393225, 655360, 4, 393226, 655360, 4, 393220, 196608, 5, 327684, 131072, 8, 262148, 131072, 8, 196612, 131072, 8, 131076, 131072, 8, 65540, 131072, 8, 4, 131072, 8, -65532, 131072, 8, -131067, 196608, 6, -131066, 196608, 6, -131065, 196608, 6, -131064, 196608, 6, -131063, 196608, 6, -131062, 196608, 6, -131068, 131072, 6, 196615, 196608, 7, 196616, 196608, 7, 131079, 327680, 9, 131080, 327680, 9, 196610, 524288, 7, 262143, 524288, 7, 196607, 262144, 5, 131074, 524288, 5, 327678, 131072, 8, 393214, 131072, 8, 131070, 131072, 8, 65534, 131072, 8, 3, 655360, 8, 65539, 655360, 8, 131075, 655360, 9, 393219, 655360, 9, 262147, 655360, 8, 327683, 655360, 8, 196611, 655360, 8, 262142, 131072, 8, 196606, 131072, 9, 458750, 131072, 9, 458751, 262144, 5, 393216, 327680, 3, 393217, 327680, 3, 393218, 524288, 5, -1, 131072, 2, -65534, 131072, 2, -65533, 720896, 3, -2, 65536, 3, -65537, 196608, 1, -131072, 131072, 2, -131071, 131072, 2, -131070, 589824, 1, -65538, 65536, 1, -131073, 65536, 1, -131069, 720896, 1, -196606, 720896, 1, -196608, 262144, 0, -196607, 327680, 0, 458754, 655360, 9, 524287, 131072, 9, 458752, 196608, 9, 458753, 262144, 9) diff --git a/DungeonShooting_Godot/src/game/manager/ResourcePath.cs b/DungeonShooting_Godot/src/game/manager/ResourcePath.cs index 392b88e..707171f 100644 --- a/DungeonShooting_Godot/src/game/manager/ResourcePath.cs +++ b/DungeonShooting_Godot/src/game/manager/ResourcePath.cs @@ -428,6 +428,7 @@ public const string resource_tileSet_map1_TileSet1_tres = "res://resource/tileSet/map1/TileSet1.tres"; public const string resource_tileSet_map1_website_txt = "res://resource/tileSet/map1/website.txt"; public const string resource_tileSprite_map1_16x16dungeoniiwallreconfigv04spritesheet_png = "res://resource/tileSprite/map1/16x16 dungeon ii wall reconfig v04 spritesheet.png"; + public const string resource_tileSprite_map2_DungeonTilesetSpikes_png = "res://resource/tileSprite/map2/Dungeon Tileset + Spikes.png"; public const string scene_Main_tscn = "res://scene/Main.tscn"; public const string scene_World_tscn = "res://scene/World.tscn"; public const string scene_test_TestCreateSector_tscn = "res://scene/test/TestCreateSector.tscn"; diff --git a/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs b/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs index 205f45e..a904716 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs @@ -732,6 +732,23 @@ var arr = new Array(list); //绘制自动图块 SetCellsTerrainConnect(AutoFloorLayer, arr, _terrainSet, _terrain, false); + //---- 测试代码 + // var usedRect = GetUsedRect(); + // var endX = usedRect.End.X; + // var endY = usedRect.End.X; + // for (var x = usedRect.Position.X; x < endX; x++) + // { + // for (int y = usedRect.Position.Y; y < endY; y++) + // { + // var temp = GetCellAtlasCoords(AutoFloorLayer, new Vector2I(x, y)); + // var flag = temp == _autoTileConfig.T.AutoTileCoord || temp == _autoTileConfig.OUT_LT.AutoTileCoord || temp == _autoTileConfig.OUT_RT.AutoTileCoord; + // if (flag) + // { + // SetCell(AutoFloorLayer, new Vector2I(x, y - 1), _sourceId, _autoTileConfig.T.AutoTileCoord); + // break; + // } + // } + // } //计算区域 CalcTileRect(true); //将墙壁移动到指定层