petites corrections du soir
j'ai la flemme de tout indiquer ici découvre avec plaisir, si le plaisir tu as.
This commit is contained in:
@@ -22,8 +22,8 @@ custom_template/debug=""
|
|||||||
custom_template/release=""
|
custom_template/release=""
|
||||||
variant/extensions_support=false
|
variant/extensions_support=false
|
||||||
variant/thread_support=false
|
variant/thread_support=false
|
||||||
vram_texture_compression/for_desktop=true
|
vram_texture_compression/for_desktop=false
|
||||||
vram_texture_compression/for_mobile=false
|
vram_texture_compression/for_mobile=true
|
||||||
html/export_icon=true
|
html/export_icon=true
|
||||||
html/custom_html_shell=""
|
html/custom_html_shell=""
|
||||||
html/head_include=""
|
html/head_include=""
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -63,5 +63,7 @@ grab={
|
|||||||
|
|
||||||
[rendering]
|
[rendering]
|
||||||
|
|
||||||
|
textures/canvas_textures/default_texture_filter=0
|
||||||
renderer/rendering_method="gl_compatibility"
|
renderer/rendering_method="gl_compatibility"
|
||||||
renderer/rendering_method.mobile="gl_compatibility"
|
renderer/rendering_method.mobile="gl_compatibility"
|
||||||
|
textures/vram_compression/import_etc2_astc=true
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ func _ready() -> void:
|
|||||||
astar_grid = AStarGrid2D.new()
|
astar_grid = AStarGrid2D.new()
|
||||||
astar_grid.region = world.get_used_rect()
|
astar_grid.region = world.get_used_rect()
|
||||||
astar_grid.cell_size = Vector2(48, 48)
|
astar_grid.cell_size = Vector2(48, 48)
|
||||||
astar_grid.diagonal_mode = AStarGrid2D.DIAGONAL_MODE_AT_LEAST_ONE_WALKABLE
|
astar_grid.set_default_compute_heuristic(AStarGrid2D.HEURISTIC_MANHATTAN)
|
||||||
|
astar_grid.set_default_estimate_heuristic(AStarGrid2D.HEURISTIC_MANHATTAN)
|
||||||
astar_grid.update()
|
astar_grid.update()
|
||||||
|
|
||||||
# only take into account the tiles that are marked with a navigation layer for cars
|
# only take into account the tiles that are marked with a navigation layer for cars
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ point_count = 15
|
|||||||
|
|
||||||
[sub_resource type="Curve2D" id="Curve2D_nircx"]
|
[sub_resource type="Curve2D" id="Curve2D_nircx"]
|
||||||
_data = {
|
_data = {
|
||||||
"points": PackedVector2Array(0, 0, 0, 0, 803, 1569, 0, 0, 0, 0, 910, 1573, 0, 0, 0, 0, 913, 1368, 0, 0, 0, 0, 1938, 1371, 0, 0, 0, 0, 1931, 342, 0, 0, 0, 0, 2082, 333, 0, 0, 0, 0, 2086, -88, 0, 0, 0, 0, 1656, -97, 0, 0, 0, 0, 1649, 73, 0, 0, 0, 0, 912.469, 60.5339, 0, 0, 0, 0, 904, -1165, 0, 0, 0, 0, -890, -1162, 0, 0, 0, 0, -885, -108, 0, 0, 0, 0, -1062, -106, 0, 0, 0, 0, -1073, 283, 0, 0, 0, 0, -624, 293, 0, 0, 0, 0, -616, 161, 0, 0, 0, 0, -577, 160, 0, 0, 0, 0, 798, 164, 0, 0, 0, 0, 806, 1560)
|
"points": PackedVector2Array(0, 0, 0, 0, 803, 1569, 0, 0, 0, 0, 910, 1573, 0, 0, 0, 0, 913, 1368, 0, 0, 0, 0, 1938, 1371, 0, 0, 0, 0, 1931, 342, 0, 0, 0, 0, 2082, 333, 0, 0, 0, 0, 2086, -88, 0, 0, 0, 0, 1656, -97, 0, 0, 0, 0, 1649, 73, 0, 0, 0, 0, 912.469, 60.5339, 0, 0, 0, 0, 904, -1165, 0, 0, 0, 0, -890, -1162, 0, 0, 0, 0, -885, -108, 0, 0, 0, 0, -1062, -106, 0, 0, 0, 0, -1073, 283, 0, 0, 0, 0, -624, 293, 0, 0, 0, 0, -616, 161, 0, 0, 0, 0, -577, 160, 0, 0, 0, 0, 823, 165, 0, 0, 0, 0, 802, 305, 0, 0, 0, 0, 806, 1560)
|
||||||
}
|
}
|
||||||
point_count = 20
|
point_count = 21
|
||||||
|
|
||||||
[node name="scene1" type="Node2D"]
|
[node name="scene1" type="Node2D"]
|
||||||
|
|
||||||
|
|||||||
@@ -43,10 +43,10 @@ tile_set = ExtResource("3_ulyk6")
|
|||||||
tile_map_data = PackedByteArray(0, 0, 0, 0, 253, 255, 4, 0, 18, 0, 17, 0, 0, 0, 0, 0, 251, 255, 4, 0, 18, 0, 15, 0, 0, 0, 0, 0, 252, 255, 4, 0, 18, 0, 16, 0, 0, 0, 0, 0, 254, 255, 4, 0, 18, 0, 18, 0, 0, 0)
|
tile_map_data = PackedByteArray(0, 0, 0, 0, 253, 255, 4, 0, 18, 0, 17, 0, 0, 0, 0, 0, 251, 255, 4, 0, 18, 0, 15, 0, 0, 0, 0, 0, 252, 255, 4, 0, 18, 0, 16, 0, 0, 0, 0, 0, 254, 255, 4, 0, 18, 0, 18, 0, 0, 0)
|
||||||
tile_set = ExtResource("3_ulyk6")
|
tile_set = ExtResource("3_ulyk6")
|
||||||
|
|
||||||
[node name="ZIndexControler" parent="." instance=ExtResource("4_k52t8")]
|
[node name="ZIndexControler" parent="Sempahore" instance=ExtResource("4_k52t8")]
|
||||||
position = Vector2(-2, 6)
|
position = Vector2(-2, 6)
|
||||||
|
|
||||||
[node name="ShapeCast2D" type="ShapeCast2D" parent="ZIndexControler"]
|
[node name="ShapeCast2D" type="ShapeCast2D" parent="Sempahore/ZIndexControler"]
|
||||||
position = Vector2(21, -15)
|
position = Vector2(21, -15)
|
||||||
shape = SubResource("RectangleShape2D_36vt6")
|
shape = SubResource("RectangleShape2D_36vt6")
|
||||||
target_position = Vector2(2, -209)
|
target_position = Vector2(2, -209)
|
||||||
|
|||||||
74
urban_furnitures/semaphores/down_semaphore.tscn
Normal file
74
urban_furnitures/semaphores/down_semaphore.tscn
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
[gd_scene load_steps=8 format=4 uid="uid://djlp0et1giup2"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://urban_furnitures/semaphores/high_semaphore.gd" id="1_w5kby"]
|
||||||
|
[ext_resource type="TileSet" uid="uid://ckj00wy20rkfx" path="res://assest/tilesets/exterieur.tres" id="2_igk5i"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://brh7cqaxc13ie" path="res://zindex/ZIndexControler.tscn" id="3_va7oi"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://dpyadhlqawviq" path="res://vehicules/brakeZone.tscn" id="4_3cw57"]
|
||||||
|
|
||||||
|
[sub_resource type="CircleShape2D" id="CircleShape2D_4c8ro"]
|
||||||
|
radius = 15.0
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_36vt6"]
|
||||||
|
size = Vector2(35, 5)
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_y0214"]
|
||||||
|
size = Vector2(200, 95.5)
|
||||||
|
|
||||||
|
[node name="Node2D" type="Node2D"]
|
||||||
|
script = ExtResource("1_w5kby")
|
||||||
|
|
||||||
|
[node name="Sempahore" type="StaticBody2D" parent="."]
|
||||||
|
|
||||||
|
[node name="abovePart" type="TileMapLayer" parent="Sempahore"]
|
||||||
|
z_index = 2000
|
||||||
|
tile_map_data = PackedByteArray("AAAAAPv/BAAMAIMAAAAAAPz/BAAMAIQAAAABAPv/BAANAIMAAAABAPz/BAANAIQAAAACAPv/BAAOAIMAAAACAPz/BAAOAIQAAAADAPz/BAAPAIQAAAA=")
|
||||||
|
tile_set = ExtResource("2_igk5i")
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Sempahore"]
|
||||||
|
position = Vector2(25, -15)
|
||||||
|
shape = SubResource("CircleShape2D_4c8ro")
|
||||||
|
|
||||||
|
[node name="pylon" type="TileMapLayer" parent="Sempahore"]
|
||||||
|
tile_map_data = PackedByteArray("AAAAAP3/BAATAIUAAAAAAP7/BAATAIYAAAAAAP//BAATAIcAAAA=")
|
||||||
|
tile_set = ExtResource("2_igk5i")
|
||||||
|
|
||||||
|
[node name="ZIndexControler" parent="Sempahore" instance=ExtResource("3_va7oi")]
|
||||||
|
position = Vector2(-2, 6)
|
||||||
|
|
||||||
|
[node name="ShapeCast2D" type="ShapeCast2D" parent="Sempahore/ZIndexControler"]
|
||||||
|
position = Vector2(29, -16)
|
||||||
|
shape = SubResource("RectangleShape2D_36vt6")
|
||||||
|
target_position = Vector2(-1, -126)
|
||||||
|
|
||||||
|
[node name="red" type="TileMapLayer" parent="Sempahore"]
|
||||||
|
z_index = 2000
|
||||||
|
tile_map_data = PackedByteArray("AAACAPz/BAAKAIYAAAADAPz/BAALAIYAAAA=")
|
||||||
|
tile_set = ExtResource("2_igk5i")
|
||||||
|
|
||||||
|
[node name="yellow" type="TileMapLayer" parent="Sempahore"]
|
||||||
|
z_index = 2000
|
||||||
|
tile_map_data = PackedByteArray("AAACAPz/BAAKAIYAAAADAPz/BAALAIYAAAA=")
|
||||||
|
tile_set = ExtResource("2_igk5i")
|
||||||
|
|
||||||
|
[node name="green" type="TileMapLayer" parent="Sempahore"]
|
||||||
|
z_index = 2000
|
||||||
|
tile_map_data = PackedByteArray("AAACAPz/BAAKAIYAAAADAPz/BAALAIYAAAA=")
|
||||||
|
tile_set = ExtResource("2_igk5i")
|
||||||
|
|
||||||
|
[node name="Timer" type="Timer" parent="."]
|
||||||
|
wait_time = 5.0
|
||||||
|
one_shot = true
|
||||||
|
autostart = true
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="."]
|
||||||
|
offset_right = 40.0
|
||||||
|
offset_bottom = 23.0
|
||||||
|
|
||||||
|
[node name="brakeZone" parent="." instance=ExtResource("4_3cw57")]
|
||||||
|
|
||||||
|
[node name="CollisionShape2D2" type="CollisionShape2D" parent="brakeZone"]
|
||||||
|
position = Vector2(101, -115)
|
||||||
|
rotation = 1.5708
|
||||||
|
shape = SubResource("RectangleShape2D_y0214")
|
||||||
|
|
||||||
|
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]
|
||||||
@@ -4,7 +4,7 @@ class_name LightSemaphore
|
|||||||
@export var dependantSemaphore : LightSemaphore = null
|
@export var dependantSemaphore : LightSemaphore = null
|
||||||
@export var hasOwnTimerEnabled = true
|
@export var hasOwnTimerEnabled = true
|
||||||
@onready var lights := [$Sempahore/green, $Sempahore/yellow, $Sempahore/red ];
|
@onready var lights := [$Sempahore/green, $Sempahore/yellow, $Sempahore/red ];
|
||||||
var light = 0;
|
@export var light = 0;
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
$brakeZone.get_child(1).disabled = !light;
|
$brakeZone.get_child(1).disabled = !light;
|
||||||
|
|||||||
@@ -43,10 +43,10 @@ tile_set = ExtResource("2_iui5y")
|
|||||||
tile_map_data = PackedByteArray(0, 0, 0, 0, 253, 255, 4, 0, 16, 0, 13, 0, 0, 0)
|
tile_map_data = PackedByteArray(0, 0, 0, 0, 253, 255, 4, 0, 16, 0, 13, 0, 0, 0)
|
||||||
tile_set = ExtResource("2_iui5y")
|
tile_set = ExtResource("2_iui5y")
|
||||||
|
|
||||||
[node name="ZIndexControler" parent="." instance=ExtResource("3_rmo1c")]
|
[node name="ZIndexControler" parent="Sempahore" instance=ExtResource("3_rmo1c")]
|
||||||
position = Vector2(-2, 6)
|
position = Vector2(-2, 6)
|
||||||
|
|
||||||
[node name="ShapeCast2D" type="ShapeCast2D" parent="ZIndexControler"]
|
[node name="ShapeCast2D" type="ShapeCast2D" parent="Sempahore/ZIndexControler"]
|
||||||
position = Vector2(21, -15)
|
position = Vector2(21, -15)
|
||||||
shape = SubResource("RectangleShape2D_36vt6")
|
shape = SubResource("RectangleShape2D_36vt6")
|
||||||
target_position = Vector2(2, -209)
|
target_position = Vector2(2, -209)
|
||||||
|
|||||||
74
urban_furnitures/semaphores/up_semaphore.tscn
Normal file
74
urban_furnitures/semaphores/up_semaphore.tscn
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
[gd_scene load_steps=8 format=4 uid="uid://btvlfkbqe6f4j"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://urban_furnitures/semaphores/high_semaphore.gd" id="1_u47jh"]
|
||||||
|
[ext_resource type="TileSet" uid="uid://ckj00wy20rkfx" path="res://assest/tilesets/exterieur.tres" id="2_fdc55"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://brh7cqaxc13ie" path="res://zindex/ZIndexControler.tscn" id="3_cla2j"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://dpyadhlqawviq" path="res://vehicules/brakeZone.tscn" id="4_3ail0"]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_36vt6"]
|
||||||
|
size = Vector2(35, 5)
|
||||||
|
|
||||||
|
[sub_resource type="CircleShape2D" id="CircleShape2D_4c8ro"]
|
||||||
|
radius = 15.0
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_y0214"]
|
||||||
|
size = Vector2(200, 95.5)
|
||||||
|
|
||||||
|
[node name="Node2D" type="Node2D"]
|
||||||
|
script = ExtResource("1_u47jh")
|
||||||
|
|
||||||
|
[node name="Sempahore" type="StaticBody2D" parent="."]
|
||||||
|
|
||||||
|
[node name="abovePart" type="TileMapLayer" parent="Sempahore"]
|
||||||
|
z_index = 2000
|
||||||
|
tile_map_data = PackedByteArray("AAD9//z/BAAQAIQAAAD+//v/BAARAIMAAAD+//z/BAARAIQAAAD///v/BAASAIMAAAD///z/BAASAIQAAAAAAPv/BAATAIMAAAAAAPz/BAATAIQAAAA=")
|
||||||
|
tile_set = ExtResource("2_fdc55")
|
||||||
|
|
||||||
|
[node name="pylon" type="TileMapLayer" parent="Sempahore"]
|
||||||
|
tile_map_data = PackedByteArray("AAAAAPv/BAATAIMAAAAAAPz/BAATAIQAAAAAAP3/BAATAIUAAAAAAP7/BAATAIYAAAAAAP//BAATAIcAAAA=")
|
||||||
|
tile_set = ExtResource("2_fdc55")
|
||||||
|
|
||||||
|
[node name="ZIndexControler" parent="Sempahore" instance=ExtResource("3_cla2j")]
|
||||||
|
position = Vector2(-2, 6)
|
||||||
|
|
||||||
|
[node name="ShapeCast2D" type="ShapeCast2D" parent="Sempahore/ZIndexControler"]
|
||||||
|
position = Vector2(28, -32)
|
||||||
|
shape = SubResource("RectangleShape2D_36vt6")
|
||||||
|
target_position = Vector2(-1, -110)
|
||||||
|
|
||||||
|
[node name="red" type="TileMapLayer" parent="Sempahore"]
|
||||||
|
z_index = 2000
|
||||||
|
tile_map_data = PackedByteArray("AAD9//z/BAAHAIQAAAD+//z/BAAIAIQAAAA=")
|
||||||
|
tile_set = ExtResource("2_fdc55")
|
||||||
|
|
||||||
|
[node name="yellow" type="TileMapLayer" parent="Sempahore"]
|
||||||
|
z_index = 2000
|
||||||
|
tile_map_data = PackedByteArray("AAD9//z/BAAHAIMAAAD+//z/BAAIAIMAAAA=")
|
||||||
|
tile_set = ExtResource("2_fdc55")
|
||||||
|
|
||||||
|
[node name="green" type="TileMapLayer" parent="Sempahore"]
|
||||||
|
z_index = 2000
|
||||||
|
tile_map_data = PackedByteArray("AAD9//z/BAAHAIIAAAD+//z/BAAIAIIAAAA=")
|
||||||
|
tile_set = ExtResource("2_fdc55")
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Sempahore"]
|
||||||
|
position = Vector2(26, -15)
|
||||||
|
shape = SubResource("CircleShape2D_4c8ro")
|
||||||
|
|
||||||
|
[node name="Timer" type="Timer" parent="."]
|
||||||
|
wait_time = 5.0
|
||||||
|
one_shot = true
|
||||||
|
autostart = true
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="."]
|
||||||
|
offset_right = 40.0
|
||||||
|
offset_bottom = 23.0
|
||||||
|
|
||||||
|
[node name="brakeZone" parent="." instance=ExtResource("4_3ail0")]
|
||||||
|
|
||||||
|
[node name="CollisionShape2D2" type="CollisionShape2D" parent="brakeZone"]
|
||||||
|
position = Vector2(-53, 99)
|
||||||
|
rotation = 1.5708
|
||||||
|
shape = SubResource("RectangleShape2D_y0214")
|
||||||
|
|
||||||
|
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]
|
||||||
@@ -15,8 +15,8 @@ func _process(delta: float) -> void:
|
|||||||
for n in range(nbCollisions):
|
for n in range(nbCollisions):
|
||||||
var colider = $ShapeCast2D.get_collider(n) as Node2D
|
var colider = $ShapeCast2D.get_collider(n) as Node2D
|
||||||
if colider != null and colider != get_parent():
|
if colider != null and colider != get_parent():
|
||||||
(get_parent() as Node2D).z_index = colider.z_index+1
|
(get_parent() as Node2D).z_index = max(colider.z_index+1, (get_parent() as Node2D).z_index)
|
||||||
hasManipulatedZIndex = true
|
hasManipulatedZIndex = true
|
||||||
$debugLabel.text = str(get_parent()) + " " + str((get_parent() as Node2D).z_index)
|
|
||||||
if !hasManipulatedZIndex:
|
if !hasManipulatedZIndex:
|
||||||
(get_parent() as Node2D).z_index = 100
|
(get_parent() as Node2D).z_index = 100
|
||||||
|
$debugLabel.text = str(get_parent()) + " " + str((get_parent() as Node2D).z_index)
|
||||||
|
|||||||
Reference in New Issue
Block a user