improve maps

This commit is contained in:
interfisch 2024-12-21 15:13:29 +01:00
parent 0df15ac598
commit d466ac763e
8 changed files with 199 additions and 4 deletions

View file

@ -222,6 +222,7 @@ width = 8.0
texture = ExtResource("4_46p8j")
texture_mode = 1
script = ExtResource("6_50nf2")
smoothingradius = 0
[node name="road_r" type="StaticBody2D" parent="Line2D_right_inside"]
collision_layer = 3
@ -244,6 +245,7 @@ width = 8.0
texture = ExtResource("4_46p8j")
texture_mode = 1
script = ExtResource("6_50nf2")
smoothingradius = 0
[node name="road_r" type="StaticBody2D" parent="Line2D_outer_right"]
collision_layer = 3
@ -265,6 +267,7 @@ width = 6.0
texture = ExtResource("4_46p8j")
texture_mode = 1
script = ExtResource("6_50nf2")
smoothingradius = 0
[node name="road_l" type="StaticBody2D" parent="Line2D2_left_inside"]
collision_layer = 3
@ -281,12 +284,12 @@ region_rect = Rect2(32, 0, 32, 32)
[node name="Line2D_rectangle" type="Line2D" parent="."]
z_index = 1
points = PackedVector2Array(-99, -183, 126, -182, 127, -123, -100, -122, -100, -181)
closed = true
points = PackedVector2Array(-411, -180, 126, -182, 127, -123, -100, -122, -101, -175)
width = 6.0
texture = ExtResource("4_46p8j")
texture_mode = 1
script = ExtResource("6_50nf2")
smoothingradius = 0
[node name="road_l" type="StaticBody2D" parent="Line2D_rectangle"]
collision_layer = 3

View file

@ -1,10 +1,12 @@
[gd_scene load_steps=33 format=3 uid="uid://bilsj1h72s23a"]
[gd_scene load_steps=35 format=3 uid="uid://bilsj1h72s23a"]
[ext_resource type="Texture2D" uid="uid://csknopg1cbqbq" path="res://sprites/background/green_gradient.png" id="2_mev6t"]
[ext_resource type="Texture2D" uid="uid://5l1t6nyjn022" path="res://sprites/road/road_border.png" id="3_q2khr"]
[ext_resource type="Texture2D" uid="uid://gydxil7qf7jc" path="res://sprites/road/road_trim.png" id="5_xsnl8"]
[ext_resource type="Script" path="res://scripts/roadborder.gd" id="6_50nf2"]
[ext_resource type="Texture2D" uid="uid://ba7g1ewwchn6c" path="res://sprites/smooth_fields/fields_animal_001.png" id="6_c655a"]
[ext_resource type="Script" path="res://scripts/generate_road_polyon.gd" id="6_x0jfh"]
[ext_resource type="Texture2D" uid="uid://bdpm76vsgrpc0" path="res://sprites/smooth_fields/fields_animal_002.png" id="7_frdrh"]
[ext_resource type="Texture2D" uid="uid://bn31voko78y3i" path="res://sprites/smooth_fields/fields_bush_001.png" id="9_cssop"]
[ext_resource type="Texture2D" uid="uid://bwow1hv3be0gh" path="res://sprites/smooth_fields/fields_bush_002.png" id="10_y6sb7"]
[ext_resource type="Texture2D" uid="uid://bnknq4uqmfjke" path="res://sprites/smooth_fields/fields_bush_003.png" id="11_akah2"]
@ -129,6 +131,16 @@ z_index = 20
texture_filter = 1
position = Vector2(0, 1)
[node name="FieldsAnimal001" type="Sprite2D" parent="Scenery2D"]
position = Vector2(584, -863)
scale = Vector2(0.29085, 0.29085)
texture = ExtResource("6_c655a")
[node name="FieldsAnimal002" type="Sprite2D" parent="Scenery2D"]
position = Vector2(-693, -738)
scale = Vector2(0.315, 0.315)
texture = ExtResource("7_frdrh")
[node name="FieldsBush001" type="Sprite2D" parent="Scenery2D"]
position = Vector2(-319, -12)
texture = ExtResource("9_cssop")

111
scenes/map_05.tscn Normal file
View file

@ -0,0 +1,111 @@
[gd_scene load_steps=10 format=3 uid="uid://cu7olkgkyy2tq"]
[ext_resource type="Texture2D" uid="uid://csknopg1cbqbq" path="res://sprites/background/green_gradient.png" id="1_nq5g7"]
[ext_resource type="Texture2D" uid="uid://5l1t6nyjn022" path="res://sprites/road/road_border.png" id="3_mivmq"]
[ext_resource type="Script" path="res://scripts/roadborder.gd" id="4_8hrwh"]
[ext_resource type="Texture2D" uid="uid://gydxil7qf7jc" path="res://sprites/road/road_trim.png" id="5_5a0eo"]
[ext_resource type="Script" path="res://scripts/generate_road_polyon.gd" id="6_vdo8x"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_daqun"]
size = Vector2(23, 327)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_dltky"]
size = Vector2(35.75, 116)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_uys5r"]
size = Vector2(165, 34)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_82iti"]
size = Vector2(53, 71)
[node name="Map" type="Node"]
[node name="CanvasLayer" type="CanvasLayer" parent="."]
layer = -1
[node name="Sprite2D" type="Sprite2D" parent="CanvasLayer"]
z_as_relative = false
position = Vector2(659, 312)
scale = Vector2(0.496296, 0.496296)
texture = ExtResource("1_nq5g7")
[node name="Line2D2_right" type="Line2D" parent="."]
z_index = 1
points = PackedVector2Array(-329, 133, 294, 132, 607, 4, 973, 8, 980, -637, 290, -642, 236, -623, 193, -601, 150, -591, -30, -590, -63, -617, -103, -670, -162, -699, -621, -702, -615, 131, -346, 132)
closed = true
width = 6.0
texture = ExtResource("3_mivmq")
texture_mode = 1
script = ExtResource("4_8hrwh")
smoothingradius = 50
minsmoothingsradius = 2
[node name="road_r" type="StaticBody2D" parent="Line2D2_right"]
collision_layer = 3
[node name="trim" type="Line2D" parent="Line2D2_right"]
width = 28.0
texture = ExtResource("5_5a0eo")
texture_mode = 1
[node name="Line2D2_left" type="Line2D" parent="."]
z_index = 1
points = PackedVector2Array(-278, -253, 284, -244, 614, -124, 768, -121, 868, -212, 869, -562, 323, -572, 279, -551, 250, -529, 213, -513, -44, -510, -118, -530, -170, -567, -212, -596, -462, -603, -487, -623, -522, -624, -521, -587, -485, -556, -469, -48, -293, -244)
closed = true
width = 6.0
texture = ExtResource("3_mivmq")
texture_mode = 1
script = ExtResource("4_8hrwh")
smoothingradius = 50
minsmoothingsradius = 2
[node name="road_l" type="StaticBody2D" parent="Line2D2_left"]
collision_layer = 3
[node name="trim" type="Line2D" parent="Line2D2_left"]
width = 28.0
texture = ExtResource("5_5a0eo")
texture_mode = 1
[node name="Polygon2D" type="Polygon2D" parent="." node_paths=PackedStringArray("line_road_left", "line_road_right")]
color = Color(0.314316, 0.314316, 0.314316, 1)
script = ExtResource("6_vdo8x")
line_road_left = NodePath("../Line2D2_left")
line_road_right = NodePath("../Line2D2_right")
[node name="area_finish" type="Area2D" parent="."]
collision_layer = 4
collision_mask = 4
[node name="CollisionShape2D_Fin" type="CollisionShape2D" parent="area_finish"]
position = Vector2(275, -70.5)
shape = SubResource("RectangleShape2D_daqun")
[node name="area_cp0" type="Area2D" parent="."]
collision_layer = 4
collision_mask = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="area_cp0"]
position = Vector2(998.125, -775)
shape = SubResource("RectangleShape2D_dltky")
[node name="area_cp1" type="Area2D" parent="."]
collision_layer = 4
collision_mask = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="area_cp1"]
position = Vector2(409.5, -694)
shape = SubResource("RectangleShape2D_uys5r")
[node name="area_cp2" type="Area2D" parent="."]
collision_layer = 4
collision_mask = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="area_cp2"]
position = Vector2(-371, -772.5)
shape = SubResource("RectangleShape2D_82iti")
[node name="Scenery2D" type="Node2D" parent="."]
z_index = 20
texture_filter = 1
position = Vector2(0, 1)

View file

@ -33,7 +33,8 @@ func _ready() -> void:
print("Not enough points")
return
points=smoothLine(points)
if smoothingradius>0:
points=smoothLine(points)
# Add Visual extras
addCaps($fitting)

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ba7g1ewwchn6c"
path="res://.godot/imported/fields_animal_001.png-9308d13620a38e0f0ea669d0f3af926a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/smooth_fields/fields_animal_001.png"
dest_files=["res://.godot/imported/fields_animal_001.png-9308d13620a38e0f0ea669d0f3af926a.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bdpm76vsgrpc0"
path="res://.godot/imported/fields_animal_002.png-9418f442d745814bcd5a8772f9cdc986.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/smooth_fields/fields_animal_002.png"
dest_files=["res://.godot/imported/fields_animal_002.png-9418f442d745814bcd5a8772f9cdc986.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