Compare commits

..

No commits in common. "579faa06dfb296519d652b402f7da2e12dc4a134" and "5e5c94272985dc45efa448337d826949aa174158" have entirely different histories.

4 changed files with 66 additions and 232 deletions

25
Assets/Test_Tileset.tres Normal file
View file

@ -0,0 +1,25 @@
[gd_resource type="TileSet" load_steps=5 format=3 uid="uid://b7cqbf6xdbeal"]
[ext_resource type="Texture2D" uid="uid://bjyry6vvtr8h5" path="res://Assets/Sprites/PlaceHolderA.png" id="1_nuhua"]
[ext_resource type="Texture2D" uid="uid://cbtiuvqgnulmf" path="res://Assets/Sprites/PlaceHolderB.png" id="2_jl0te"]
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_urqd5"]
texture = ExtResource("1_nuhua")
texture_region_size = Vector2i(8, 8)
0:0/0 = 0
0:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
0:0/0/physics_layer_0/angular_velocity = 0.0
0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-4, -4, 4, -4, 4, 4, -4, 4)
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_7bjb0"]
texture = ExtResource("2_jl0te")
texture_region_size = Vector2i(8, 8)
0:0/0 = 0
0:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
0:0/0/physics_layer_0/angular_velocity = 0.0
[resource]
tile_size = Vector2i(8, 8)
physics_layer_0/collision_layer = 1
sources/0 = SubResource("TileSetAtlasSource_urqd5")
sources/1 = SubResource("TileSetAtlasSource_7bjb0")

View file

@ -8,42 +8,26 @@ texture_region_size = Vector2i(32, 32)
0:0/0 = 0
0:0/0/terrain_set = 0
0:0/0/terrain = 0
0:0/0/probability = 2.0
0:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
0:0/0/physics_layer_0/angular_velocity = 0.0
0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(12, 16, -12, 16, -12, -8, -8.5, -12, 8.5, -12, 12, -8)
0:0/0/terrains_peering_bit/bottom_side = 0
1:0/0 = 0
1:0/0/terrain_set = 0
1:0/0/terrain = 0
1:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
1:0/0/physics_layer_0/angular_velocity = 0.0
1:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(12.5, 12.5, 12, 16, -12, 16, -12, -8, -8, -12, 16, -12, 16, 12)
1:0/0/terrains_peering_bit/right_side = 0
1:0/0/terrains_peering_bit/bottom_side = 0
2:0/0 = 0
2:0/0/terrain_set = 0
2:0/0/terrain = 0
2:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
2:0/0/physics_layer_0/angular_velocity = 0.0
2:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, 12, -16, -12, 16, -12, 16, 12, 12.5, 12.5, 12, 16, -12, 16, -12.5, 12.5)
2:0/0/terrains_peering_bit/right_side = 0
2:0/0/terrains_peering_bit/bottom_side = 0
2:0/0/terrains_peering_bit/left_side = 0
3:0/0 = 0
3:0/0/terrain_set = 0
3:0/0/terrain = 0
3:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
3:0/0/physics_layer_0/angular_velocity = 0.0
3:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-12.5, 12.5, -16, 12, -16, -12, 8, -12, 12, -8, 12, 16, -12, 16)
3:0/0/terrains_peering_bit/bottom_side = 0
3:0/0/terrains_peering_bit/left_side = 0
4:0/0 = 0
4:0/0/terrain_set = 0
4:0/0/terrain = 0
4:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
4:0/0/physics_layer_0/angular_velocity = 0.0
4:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(12, 16, -12, 16, -12.5, 12.5, -16, 12, -16, -16, 12, -16, 12.5, -12.5, 16, -12, 16, 12, 12.5, 12.5)
4:0/0/terrains_peering_bit/right_side = 0
4:0/0/terrains_peering_bit/bottom_side = 0
4:0/0/terrains_peering_bit/left_side = 0
@ -52,9 +36,6 @@ texture_region_size = Vector2i(32, 32)
5:0/0 = 0
5:0/0/terrain_set = 0
5:0/0/terrain = 0
5:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
5:0/0/physics_layer_0/angular_velocity = 0.0
5:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-12.5, 12.5, -16, 12, -16, -12, 16, -12, 16, 16, -12, 16)
5:0/0/terrains_peering_bit/right_side = 0
5:0/0/terrains_peering_bit/bottom_right_corner = 0
5:0/0/terrains_peering_bit/bottom_side = 0
@ -62,9 +43,6 @@ texture_region_size = Vector2i(32, 32)
6:0/0 = 0
6:0/0/terrain_set = 0
6:0/0/terrain = 0
6:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
6:0/0/physics_layer_0/angular_velocity = 0.0
6:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(12.5, 12.5, 16, 12, 16, -12, -16, -12, -16, 16, 12, 16)
6:0/0/terrains_peering_bit/right_side = 0
6:0/0/terrains_peering_bit/bottom_side = 0
6:0/0/terrains_peering_bit/bottom_left_corner = 0
@ -72,9 +50,6 @@ texture_region_size = Vector2i(32, 32)
7:0/0 = 0
7:0/0/terrain_set = 0
7:0/0/terrain = 0
7:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
7:0/0/physics_layer_0/angular_velocity = 0.0
7:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, 12, -16, -12, -12.5, -12.5, -12, -16, 16, -16, 16, 12, 12.5, 12.5, 12, 16, -12, 16, -12.5, 12.5)
7:0/0/terrains_peering_bit/right_side = 0
7:0/0/terrains_peering_bit/bottom_side = 0
7:0/0/terrains_peering_bit/left_side = 0
@ -83,19 +58,12 @@ texture_region_size = Vector2i(32, 32)
8:0/0 = 0
8:0/0/terrain_set = 0
8:0/0/terrain = 0
8:0/0/probability = 2.0
8:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
8:0/0/physics_layer_0/angular_velocity = 0.0
8:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(16, 16, -12, 16, -12, -8, -8, -12, 16, -12)
8:0/0/terrains_peering_bit/right_side = 0
8:0/0/terrains_peering_bit/bottom_right_corner = 0
8:0/0/terrains_peering_bit/bottom_side = 0
9:0/0 = 0
9:0/0/terrain_set = 0
9:0/0/terrain = 0
9:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
9:0/0/physics_layer_0/angular_velocity = 0.0
9:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(12.5, -12.5, 16, -12, 16, 16, -16, 16, -16, -12, -12.5, -12.5, -12, -16, 12, -16)
9:0/0/terrains_peering_bit/right_side = 0
9:0/0/terrains_peering_bit/bottom_right_corner = 0
9:0/0/terrains_peering_bit/bottom_side = 0
@ -105,9 +73,6 @@ texture_region_size = Vector2i(32, 32)
10:0/0 = 0
10:0/0/terrain_set = 0
10:0/0/terrain = 0
10:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
10:0/0/physics_layer_0/angular_velocity = 0.0
10:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(16, -12, 16, 16, -16, 16, -16, -12)
10:0/0/terrains_peering_bit/right_side = 0
10:0/0/terrains_peering_bit/bottom_right_corner = 0
10:0/0/terrains_peering_bit/bottom_side = 0
@ -116,36 +81,23 @@ texture_region_size = Vector2i(32, 32)
11:0/0 = 0
11:0/0/terrain_set = 0
11:0/0/terrain = 0
11:0/0/probability = 2.0
11:0/0/physics_layer_0/linear_velocity = Vector2(0, 0)
11:0/0/physics_layer_0/angular_velocity = 0.0
11:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, 16, -16, -12, 8, -12, 12, -8, 12, 16)
11:0/0/terrains_peering_bit/bottom_side = 0
11:0/0/terrains_peering_bit/bottom_left_corner = 0
11:0/0/terrains_peering_bit/left_side = 0
0:1/0 = 0
0:1/0/terrain_set = 0
0:1/0/terrain = 0
0:1/0/physics_layer_0/linear_velocity = Vector2(0, 0)
0:1/0/physics_layer_0/angular_velocity = 0.0
0:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-12, -16, 12, -16, 12, 16, -12, 16)
0:1/0/terrains_peering_bit/bottom_side = 0
0:1/0/terrains_peering_bit/top_side = 0
1:1/0 = 0
1:1/0/terrain_set = 0
1:1/0/terrain = 0
1:1/0/physics_layer_0/linear_velocity = Vector2(0, 0)
1:1/0/physics_layer_0/angular_velocity = 0.0
1:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(12, 16, -12, 16, -12, -16, 12, -16, 12.5, -12.5, 16, -12, 16, 12, 12.5, 12.5)
1:1/0/terrains_peering_bit/right_side = 0
1:1/0/terrains_peering_bit/bottom_side = 0
1:1/0/terrains_peering_bit/top_side = 0
2:1/0 = 0
2:1/0/terrain_set = 0
2:1/0/terrain = 0
2:1/0/physics_layer_0/linear_velocity = Vector2(0, 0)
2:1/0/physics_layer_0/angular_velocity = 0.0
2:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, 12, -16, -12, -12.5, -12.5, -12, -16, 12, -16, 12.5, -12.5, 16, -12, 16, 12, 12.5, 12.5, 12, 16, -12, 16, -12.5, 12.5)
2:1/0/terrains_peering_bit/right_side = 0
2:1/0/terrains_peering_bit/bottom_side = 0
2:1/0/terrains_peering_bit/left_side = 0
@ -153,18 +105,12 @@ texture_region_size = Vector2i(32, 32)
3:1/0 = 0
3:1/0/terrain_set = 0
3:1/0/terrain = 0
3:1/0/physics_layer_0/linear_velocity = Vector2(0, 0)
3:1/0/physics_layer_0/angular_velocity = 0.0
3:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-12, -16, 12, -16, 12, 16, -12, 16, -12.5, 12.5, -16, 12, -16, -12, -12.5, -12.5)
3:1/0/terrains_peering_bit/bottom_side = 0
3:1/0/terrains_peering_bit/left_side = 0
3:1/0/terrains_peering_bit/top_side = 0
4:1/0 = 0
4:1/0/terrain_set = 0
4:1/0/terrain = 0
4:1/0/physics_layer_0/linear_velocity = Vector2(0, 0)
4:1/0/physics_layer_0/angular_velocity = 0.0
4:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(12.5, -12.5, 12, -16, -12, -16, -12, 16, 16, 16, 16, -12)
4:1/0/terrains_peering_bit/right_side = 0
4:1/0/terrains_peering_bit/bottom_right_corner = 0
4:1/0/terrains_peering_bit/bottom_side = 0
@ -172,9 +118,6 @@ texture_region_size = Vector2i(32, 32)
5:1/0 = 0
5:1/0/terrain_set = 0
5:1/0/terrain = 0
5:1/0/physics_layer_0/linear_velocity = Vector2(0, 0)
5:1/0/physics_layer_0/angular_velocity = 0.0
5:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-12.5, -12.5, -12, -16, 16, -16, 16, 16, -16, 16, -16, -12)
5:1/0/terrains_peering_bit/right_side = 0
5:1/0/terrains_peering_bit/bottom_right_corner = 0
5:1/0/terrains_peering_bit/bottom_side = 0
@ -185,9 +128,6 @@ texture_region_size = Vector2i(32, 32)
6:1/0 = 0
6:1/0/terrain_set = 0
6:1/0/terrain = 0
6:1/0/physics_layer_0/linear_velocity = Vector2(0, 0)
6:1/0/physics_layer_0/angular_velocity = 0.0
6:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(12.5, -12.5, 16, -12, 16, 16, -16, 16, -16, -16, 12, -16)
6:1/0/terrains_peering_bit/right_side = 0
6:1/0/terrains_peering_bit/bottom_right_corner = 0
6:1/0/terrains_peering_bit/bottom_side = 0
@ -198,9 +138,6 @@ texture_region_size = Vector2i(32, 32)
7:1/0 = 0
7:1/0/terrain_set = 0
7:1/0/terrain = 0
7:1/0/physics_layer_0/linear_velocity = Vector2(0, 0)
7:1/0/physics_layer_0/angular_velocity = 0.0
7:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-12.5, -12.5, -12, -16, 12, -16, 12, 16, -16, 16, -16, -12)
7:1/0/terrains_peering_bit/bottom_side = 0
7:1/0/terrains_peering_bit/bottom_left_corner = 0
7:1/0/terrains_peering_bit/left_side = 0
@ -208,9 +145,6 @@ texture_region_size = Vector2i(32, 32)
8:1/0 = 0
8:1/0/terrain_set = 0
8:1/0/terrain = 0
8:1/0/physics_layer_0/linear_velocity = Vector2(0, 0)
8:1/0/physics_layer_0/angular_velocity = 0.0
8:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-12, -16, 16, -16, 16, 16, -12, 16)
8:1/0/terrains_peering_bit/right_side = 0
8:1/0/terrains_peering_bit/bottom_right_corner = 0
8:1/0/terrains_peering_bit/bottom_side = 0
@ -219,9 +153,6 @@ texture_region_size = Vector2i(32, 32)
9:1/0 = 0
9:1/0/terrain_set = 0
9:1/0/terrain = 0
9:1/0/physics_layer_0/linear_velocity = Vector2(0, 0)
9:1/0/physics_layer_0/angular_velocity = 0.0
9:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(16, -16, 16, 12, 12.5, 12.5, 12, 16, -16, 16, -16, -12, -12.5, -12.5, -12, -16)
9:1/0/terrains_peering_bit/right_side = 0
9:1/0/terrains_peering_bit/bottom_side = 0
9:1/0/terrains_peering_bit/bottom_left_corner = 0
@ -231,9 +162,6 @@ texture_region_size = Vector2i(32, 32)
11:1/0 = 0
11:1/0/terrain_set = 0
11:1/0/terrain = 0
11:1/0/physics_layer_0/linear_velocity = Vector2(0, 0)
11:1/0/physics_layer_0/angular_velocity = 0.0
11:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(12.5, 12.5, 12, 16, -16, 16, -16, -16, 12, -16, 12.5, -12.5, 16, -12, 16, 12)
11:1/0/terrains_peering_bit/right_side = 0
11:1/0/terrains_peering_bit/bottom_side = 0
11:1/0/terrains_peering_bit/bottom_left_corner = 0
@ -243,42 +171,26 @@ texture_region_size = Vector2i(32, 32)
0:2/0 = 0
0:2/0/terrain_set = 0
0:2/0/terrain = 0
0:2/0/probability = 2.0
0:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
0:2/0/physics_layer_0/angular_velocity = 0.0
0:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-12, -16, 12, -16, 12, 8, 8.5, 12, -8.5, 12, -12, 8)
0:2/0/terrains_peering_bit/top_side = 0
1:2/0 = 0
1:2/0/terrain_set = 0
1:2/0/terrain = 0
1:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
1:2/0/physics_layer_0/angular_velocity = 0.0
1:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(12.5, -12.5, 16, -12, 16, 12, -8, 12, -12, 8, -12, -16, 12, -16)
1:2/0/terrains_peering_bit/right_side = 0
1:2/0/terrains_peering_bit/top_side = 0
2:2/0 = 0
2:2/0/terrain_set = 0
2:2/0/terrain = 0
2:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
2:2/0/physics_layer_0/angular_velocity = 0.0
2:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(16, -12, 16, 12, -16, 12, -16, -12, -12.5, -12.5, -12, -16, 12, -16, 12.5, -12.5)
2:2/0/terrains_peering_bit/right_side = 0
2:2/0/terrains_peering_bit/left_side = 0
2:2/0/terrains_peering_bit/top_side = 0
3:2/0 = 0
3:2/0/terrain_set = 0
3:2/0/terrain = 0
3:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
3:2/0/physics_layer_0/angular_velocity = 0.0
3:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-12.5, -12.5, -12, -16, 12, -16, 12, 8, 8, 12, -16, 12, -16, -12)
3:2/0/terrains_peering_bit/left_side = 0
3:2/0/terrains_peering_bit/top_side = 0
4:2/0 = 0
4:2/0/terrain_set = 0
4:2/0/terrain = 0
4:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
4:2/0/physics_layer_0/angular_velocity = 0.0
4:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(12.5, 12.5, 12, 16, -12, 16, -12, -16, 16, -16, 16, 12)
4:2/0/terrains_peering_bit/right_side = 0
4:2/0/terrains_peering_bit/bottom_side = 0
4:2/0/terrains_peering_bit/top_side = 0
@ -286,9 +198,6 @@ texture_region_size = Vector2i(32, 32)
5:2/0 = 0
5:2/0/terrain_set = 0
5:2/0/terrain = 0
5:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
5:2/0/physics_layer_0/angular_velocity = 0.0
5:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-12.5, 12.5, -16, 12, -16, -16, 16, -16, 16, 16, -12, 16)
5:2/0/terrains_peering_bit/right_side = 0
5:2/0/terrains_peering_bit/bottom_right_corner = 0
5:2/0/terrains_peering_bit/bottom_side = 0
@ -299,9 +208,6 @@ texture_region_size = Vector2i(32, 32)
6:2/0 = 0
6:2/0/terrain_set = 0
6:2/0/terrain = 0
6:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
6:2/0/physics_layer_0/angular_velocity = 0.0
6:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(12.5, 12.5, 12, 16, -16, 16, -16, -16, 16, -16, 16, 12)
6:2/0/terrains_peering_bit/right_side = 0
6:2/0/terrains_peering_bit/bottom_side = 0
6:2/0/terrains_peering_bit/bottom_left_corner = 0
@ -312,9 +218,6 @@ texture_region_size = Vector2i(32, 32)
7:2/0 = 0
7:2/0/terrain_set = 0
7:2/0/terrain = 0
7:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
7:2/0/physics_layer_0/angular_velocity = 0.0
7:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-12.5, 12.5, -12, 16, 12, 16, 12, -16, -16, -16, -16, 12)
7:2/0/terrains_peering_bit/bottom_side = 0
7:2/0/terrains_peering_bit/left_side = 0
7:2/0/terrains_peering_bit/top_left_corner = 0
@ -322,9 +225,6 @@ texture_region_size = Vector2i(32, 32)
8:2/0 = 0
8:2/0/terrain_set = 0
8:2/0/terrain = 0
8:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
8:2/0/physics_layer_0/angular_velocity = 0.0
8:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-12.5, -12.5, -12, -16, 16, -16, 16, 16, -12, 16, -12.5, 12.5, -16, 12, -16, -12)
8:2/0/terrains_peering_bit/right_side = 0
8:2/0/terrains_peering_bit/bottom_right_corner = 0
8:2/0/terrains_peering_bit/bottom_side = 0
@ -334,10 +234,6 @@ texture_region_size = Vector2i(32, 32)
9:2/0 = 0
9:2/0/terrain_set = 0
9:2/0/terrain = 0
9:2/0/probability = 2.0
9:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
9:2/0/physics_layer_0/angular_velocity = 0.0
9:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
9:2/0/terrains_peering_bit/right_side = 0
9:2/0/terrains_peering_bit/bottom_right_corner = 0
9:2/0/terrains_peering_bit/bottom_side = 0
@ -349,9 +245,6 @@ texture_region_size = Vector2i(32, 32)
10:2/0 = 0
10:2/0/terrain_set = 0
10:2/0/terrain = 0
10:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
10:2/0/physics_layer_0/angular_velocity = 0.0
10:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 12, -16, 12.5, -12.5, 16, -12, 16, 16, -12, 16, -12.5, 12.5, -16, 12)
10:2/0/terrains_peering_bit/right_side = 0
10:2/0/terrains_peering_bit/bottom_right_corner = 0
10:2/0/terrains_peering_bit/bottom_side = 0
@ -361,9 +254,6 @@ texture_region_size = Vector2i(32, 32)
11:2/0 = 0
11:2/0/terrain_set = 0
11:2/0/terrain = 0
11:2/0/physics_layer_0/linear_velocity = Vector2(0, 0)
11:2/0/physics_layer_0/angular_velocity = 0.0
11:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(12, 16, -16, 16, -16, -16, 12, -16)
11:2/0/terrains_peering_bit/bottom_side = 0
11:2/0/terrains_peering_bit/bottom_left_corner = 0
11:2/0/terrains_peering_bit/left_side = 0
@ -372,40 +262,22 @@ texture_region_size = Vector2i(32, 32)
0:3/0 = 0
0:3/0/terrain_set = 0
0:3/0/terrain = 0
0:3/0/probability = 2.0
0:3/0/physics_layer_0/linear_velocity = Vector2(0, 0)
0:3/0/physics_layer_0/angular_velocity = 0.0
0:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 12, -12, 8, -12, -8, -8, -12, 8, -12, 12, -8.5, 12, 8.5, 8, 12)
1:3/0 = 0
1:3/0/terrain_set = 0
1:3/0/terrain = 0
1:3/0/probability = 2.0
1:3/0/physics_layer_0/linear_velocity = Vector2(0, 0)
1:3/0/physics_layer_0/angular_velocity = 0.0
1:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(16, -12, 16, 12, -8, 12, -12, 8.5, -12, -8.5, -8, -12)
1:3/0/terrains_peering_bit/right_side = 0
2:3/0 = 0
2:3/0/terrain_set = 0
2:3/0/terrain = 0
2:3/0/physics_layer_0/linear_velocity = Vector2(0, 0)
2:3/0/physics_layer_0/angular_velocity = 0.0
2:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(16, -12, 16, 12, -16, 12, -16, -12)
2:3/0/terrains_peering_bit/right_side = 0
2:3/0/terrains_peering_bit/left_side = 0
3:3/0 = 0
3:3/0/terrain_set = 0
3:3/0/terrain = 0
3:3/0/probability = 2.0
3:3/0/physics_layer_0/linear_velocity = Vector2(0, 0)
3:3/0/physics_layer_0/angular_velocity = 0.0
3:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, 12, -16, -12, 8, -12, 12, -8.5, 12, 8.5, 8, 12)
3:3/0/terrains_peering_bit/left_side = 0
4:3/0 = 0
4:3/0/terrain_set = 0
4:3/0/terrain = 0
4:3/0/physics_layer_0/linear_velocity = Vector2(0, 0)
4:3/0/physics_layer_0/angular_velocity = 0.0
4:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(16, -12, 16, 12, 12.5, 12.5, 12, 16, -16, 16, -16, -12, -12.5, -12.5, -12, -16, 12, -16, 12.5, -12.5)
4:3/0/terrains_peering_bit/right_side = 0
4:3/0/terrains_peering_bit/bottom_side = 0
4:3/0/terrains_peering_bit/bottom_left_corner = 0
@ -414,9 +286,6 @@ texture_region_size = Vector2i(32, 32)
5:3/0 = 0
5:3/0/terrain_set = 0
5:3/0/terrain = 0
5:3/0/physics_layer_0/linear_velocity = Vector2(0, 0)
5:3/0/physics_layer_0/angular_velocity = 0.0
5:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-12.5, -12.5, -16, -12, -16, 12, 16, 12, 16, -16, -12, -16)
5:3/0/terrains_peering_bit/right_side = 0
5:3/0/terrains_peering_bit/left_side = 0
5:3/0/terrains_peering_bit/top_side = 0
@ -424,9 +293,6 @@ texture_region_size = Vector2i(32, 32)
6:3/0 = 0
6:3/0/terrain_set = 0
6:3/0/terrain = 0
6:3/0/physics_layer_0/linear_velocity = Vector2(0, 0)
6:3/0/physics_layer_0/angular_velocity = 0.0
6:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(12.5, -12.5, 16, -12, 16, 12, -16, 12, -16, -16, 12, -16)
6:3/0/terrains_peering_bit/right_side = 0
6:3/0/terrains_peering_bit/left_side = 0
6:3/0/terrains_peering_bit/top_left_corner = 0
@ -434,9 +300,6 @@ texture_region_size = Vector2i(32, 32)
7:3/0 = 0
7:3/0/terrain_set = 0
7:3/0/terrain = 0
7:3/0/physics_layer_0/linear_velocity = Vector2(0, 0)
7:3/0/physics_layer_0/angular_velocity = 0.0
7:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-12, -16, 12, -16, 12.5, -12.5, 16, -12, 16, 16, -12, 16, -12.5, 12.5, -16, 12, -16, -12, -12.5, -12.5)
7:3/0/terrains_peering_bit/right_side = 0
7:3/0/terrains_peering_bit/bottom_right_corner = 0
7:3/0/terrains_peering_bit/bottom_side = 0
@ -445,19 +308,12 @@ texture_region_size = Vector2i(32, 32)
8:3/0 = 0
8:3/0/terrain_set = 0
8:3/0/terrain = 0
8:3/0/probability = 2.0
8:3/0/physics_layer_0/linear_velocity = Vector2(0, 0)
8:3/0/physics_layer_0/angular_velocity = 0.0
8:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(16, -16, 16, 12, -8, 12, -12, 8, -12, -16)
8:3/0/terrains_peering_bit/right_side = 0
8:3/0/terrains_peering_bit/top_side = 0
8:3/0/terrains_peering_bit/top_right_corner = 0
9:3/0 = 0
9:3/0/terrain_set = 0
9:3/0/terrain = 0
9:3/0/physics_layer_0/linear_velocity = Vector2(0, 0)
9:3/0/physics_layer_0/angular_velocity = 0.0
9:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, 12, -16, -16, 16, -16, 16, 12)
9:3/0/terrains_peering_bit/right_side = 0
9:3/0/terrains_peering_bit/left_side = 0
9:3/0/terrains_peering_bit/top_left_corner = 0
@ -466,9 +322,6 @@ texture_region_size = Vector2i(32, 32)
10:3/0 = 0
10:3/0/terrain_set = 0
10:3/0/terrain = 0
10:3/0/physics_layer_0/linear_velocity = Vector2(0, 0)
10:3/0/physics_layer_0/angular_velocity = 0.0
10:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-12.5, 12.5, -16, 12, -16, -16, 16, -16, 16, 12, 12.5, 12.5, 12, 16, -12, 16)
10:3/0/terrains_peering_bit/right_side = 0
10:3/0/terrains_peering_bit/bottom_side = 0
10:3/0/terrains_peering_bit/left_side = 0
@ -478,17 +331,12 @@ texture_region_size = Vector2i(32, 32)
11:3/0 = 0
11:3/0/terrain_set = 0
11:3/0/terrain = 0
11:3/0/probability = 2.0
11:3/0/physics_layer_0/linear_velocity = Vector2(0, 0)
11:3/0/physics_layer_0/angular_velocity = 0.0
11:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 12, -16, 12, 8, 8, 12, -16, 12)
11:3/0/terrains_peering_bit/left_side = 0
11:3/0/terrains_peering_bit/top_left_corner = 0
11:3/0/terrains_peering_bit/top_side = 0
[resource]
tile_size = Vector2i(32, 32)
physics_layer_0/collision_layer = 0
terrain_set_0/mode = 0
terrain_set_0/terrain_0/name = "Walls"
terrain_set_0/terrain_0/color = Color(1, 0.301961, 0.329412, 1)

View file

@ -1,14 +1,13 @@
[gd_scene load_steps=3 format=3 uid="uid://chfp8mm3vwh2e"]
[ext_resource type="TileSet" uid="uid://bj7uu2180mie3" path="res://Assets/Tileset.tres" id="1_a2htf"]
[ext_resource type="TileSet" uid="uid://b7cqbf6xdbeal" path="res://Assets/Test_Tileset.tres" id="1_8lepy"]
[ext_resource type="Script" path="res://Scripts/MapGenerator.gd" id="2_qvwn8"]
[node name="Node2D" type="Node2D"]
[node name="TileMap" type="TileMap" parent="."]
tile_set = ExtResource("1_a2htf")
tile_set = ExtResource("1_8lepy")
cell_quadrant_size = 8
collision_visibility_mode = 1
format = 2
script = ExtResource("2_qvwn8")
height = 33

View file

@ -1,9 +1,12 @@
extends TileMap
@export var width := 60
@export var height := 32
@export var width := 128
@export var height := 75
@export var fill_percentage := 0.65
@export var solid_id := 0
@export var non_solid_id := 1
@export var solid_threshold := 7
@export var nonsolid_threshold := 4
@ -13,8 +16,6 @@ extends TileMap
@export var cave_gen_iterations := 3
@export var cave_mine_size_threshold := 80
var tile_array : Array
func _ready():
var time = generate()
print("time for generation: " + str(time))
@ -26,45 +27,38 @@ func generate() -> float:
var start_time = Time.get_unix_time_from_system()
randomize()
setup_tile_data_array()
fill_random_noise()
for i in cave_gen_iterations:
change_cells_by_neighbor_thresholds()
set_borders_solid()
prepare_player_start_area()
connect_caves(get_caves())
for i in cave_gen_iterations:
change_cells_by_neighbor_thresholds()
set_borders_solid()
tile_array_to_terrain()
return Time.get_unix_time_from_system() - start_time
func setup_tile_data_array():
tile_array.clear()
tile_array = []
for x in width:
tile_array.append([])
for y in height:
tile_array[x].append([])
func fill_random_noise():
for x in width:
for y in height:
if randf() < fill_percentage:
set_tile_solid(x,y)
self.set_cell(0, Vector2i(x,y),solid_id, Vector2i(0, 0))
else:
set_tile_non_solid(x,y)
self.set_cell(0, Vector2i(x,y),non_solid_id, Vector2i(0, 0))
pass
func set_borders_solid():
for x in width:
set_tile_solid(x,0)
set_tile_solid(x,height-1)
self.set_cell(0, Vector2i(x,0),solid_id, Vector2i(0, 0))
self.set_cell(0, Vector2i(x,height-1),solid_id, Vector2i(0, 0))
for y in height:
set_tile_solid(0,y)
set_tile_solid(width-1,y)
self.set_cell(0, Vector2i(0,y),solid_id, Vector2i(0, 0))
self.set_cell(0, Vector2i(width-1,y),solid_id, Vector2i(0, 0))
pass
func prepare_player_start_area():
@ -82,32 +76,32 @@ func prepare_player_start_area():
for y in range(center.y - start_area_size, center.y + start_area_size):
# Decide if the tile is part of the Corner or not
if !(p2 > 0 or p2 <= - (start_area_size*2 - p*2)):
set_tile_non_solid(x,y)
self.set_cell(0, Vector2i(x,y),non_solid_id, Vector2i(0, 0))
p2 -= 1
pass
func change_cells_by_neighbor_thresholds():
for x in range(1, width-1):
for y in range(1, height-1):
for x in range(1, width):
for y in range(1, height):
# Count Solid Neighbor Cells
var count := 0
#y-1
if get_tile_solid(x-1, y-1): count +=1
if get_tile_solid(x, y-1): count +=1
if get_tile_solid(x+1, y-1): count +=1
if self.get_cell_source_id(0, Vector2i(x-1, y-1)) == solid_id: count +=1
if self.get_cell_source_id(0, Vector2i(x, y-1)) == solid_id: count +=1
if self.get_cell_source_id(0, Vector2i(x+1, y-1)) == solid_id: count +=1
#y
if get_tile_solid(x-1, y): count +=1
if get_tile_solid(x+1, y): count +=1
if self.get_cell_source_id(0, Vector2i(x-1, y)) == solid_id: count +=1
if self.get_cell_source_id(0, Vector2i(x+1, y)) == solid_id: count +=1
#y+1
if get_tile_solid(x-1, y+1): count +=1
if get_tile_solid(x, y+1): count +=1
if get_tile_solid(x+1, y+1): count +=1
if self.get_cell_source_id(0, Vector2i(x-1, y+1)) == solid_id: count +=1
if self.get_cell_source_id(0, Vector2i(x, y+1)) == solid_id: count +=1
if self.get_cell_source_id(0, Vector2i(x+1, y+1)) == solid_id: count +=1
# Check Threshold
if count < nonsolid_threshold:
set_tile_non_solid(x,y)
self.set_cell(0, Vector2i(x,y),non_solid_id, Vector2i(0, 0))
if count >= solid_threshold:
set_tile_solid(x,y)
self.set_cell(0, Vector2i(x,y),solid_id, Vector2i(0, 0))
pass
func get_caves() -> Array:
@ -116,12 +110,12 @@ func get_caves() -> Array:
for x in range (2, width-2):
for y in range (2, height-2):
if get_tile_non_solid(x, y):
if self.get_cell_source_id(0, Vector2i(x, y)) == non_solid_id:
flood_fill(x,y, caves)
for cave in caves:
for tile in cave:
set_tile_non_solid(tile.x,tile.y)
self.set_cell(0, Vector2i(tile.x,tile.y),non_solid_id, Vector2i(0, 0))
return caves
func flood_fill(tilex, tiley, caves) -> Array:
@ -132,7 +126,7 @@ func flood_fill(tilex, tiley, caves) -> Array:
if !cave.has(tile):
cave.append(tile)
set_tile_solid(tile.x,tile.y)
self.set_cell(0, Vector2i(tile.x,tile.y),solid_id, Vector2i(0, 0))
#check adjacent cells
var north = Vector2i(tile.x, tile.y+1)
@ -141,7 +135,7 @@ func flood_fill(tilex, tiley, caves) -> Array:
var west = Vector2i(tile.x-1, tile.y)
for dir in [north,south,east,west]:
if get_tile_non_solid(dir.x, dir.y):
if self.get_cell_source_id(0, dir) == non_solid_id:
if !to_fill.has(dir) and !cave.has(dir):
to_fill.append(dir)
if cave.size() >= cave_mine_size_threshold:
@ -229,41 +223,9 @@ func create_tunnel(point1, point2, cave):
drunk_x += dx
drunk_y += dy
if get_tile_solid(drunk_x, drunk_y):
set_tile_non_solid(drunk_x, drunk_y)
if self.get_cell_source_id(0, Vector2i(drunk_x, drunk_y)) == solid_id:
self.set_cell(0, Vector2i(drunk_x, drunk_y),non_solid_id, Vector2i(0, 0))
#make tunnel wider
set_tile_non_solid(drunk_x+1, drunk_y)
set_tile_non_solid(drunk_x+1, drunk_y+1)
pass
func tile_array_to_terrain():
for x in width:
for y in height:
match tile_array[x][y]:
0: set_terrain_tile_non_solid(x,y)
1: set_terrain_tile_solid(x,y)
pass
# Getter
func get_tile_solid(x : int, y : int) -> bool:
return tile_array[x][y] == 1
func get_tile_non_solid(x : int, y : int) -> bool:
return tile_array[x][y] == 0
# Setter
func set_tile_solid(x : int, y : int):
tile_array[x][y] = 1
pass
func set_tile_non_solid(x : int, y : int):
tile_array[x][y] = 0
pass
func set_terrain_tile_solid(x : int, y : int):
self.set_cells_terrain_connect(0, [Vector2i(x,y)], 0, 0, false)
pass
func set_terrain_tile_non_solid(x : int, y : int):
self.set_cell(0, Vector2i(x,y), -1)
self.set_cell(0, Vector2i(drunk_x+1, drunk_y),non_solid_id, Vector2i(0, 0))
self.set_cell(0, Vector2i(drunk_x+1, drunk_y+1),non_solid_id, Vector2i(0, 0))
pass