Plus de feux rouges et des portes qui vont vivre
Et oui du nouveau encore!
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -61,3 +61,15 @@ position = Vector2(-1, 37)
|
|||||||
position = Vector2(1, -13)
|
position = Vector2(1, -13)
|
||||||
shape = SubResource("RectangleShape2D_1kv0e")
|
shape = SubResource("RectangleShape2D_1kv0e")
|
||||||
target_position = Vector2(0, -48)
|
target_position = Vector2(0, -48)
|
||||||
|
|
||||||
|
[node name="Area2D" type="Area2D" parent="."]
|
||||||
|
collision_layer = 4
|
||||||
|
collision_mask = 4
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||||
|
position = Vector2(0, 43)
|
||||||
|
rotation = 1.5708
|
||||||
|
shape = SubResource("CapsuleShape2D_a4vmx")
|
||||||
|
|
||||||
|
[connection signal="area_entered" from="Area2D" to="." method="_on_area_2d_area_entered"]
|
||||||
|
[connection signal="body_entered" from="Area2D" to="." method="_on_area_2d_body_entered"]
|
||||||
|
|||||||
@@ -34,3 +34,6 @@ func _physics_process(delta):
|
|||||||
last_facing_direction = velocity.normalized()
|
last_facing_direction = velocity.normalized()
|
||||||
|
|
||||||
updateFacingDirectionInAnimationTree()
|
updateFacingDirectionInAnimationTree()
|
||||||
|
|
||||||
|
func _on_area_2d_body_entered(body: Node2D) -> void:
|
||||||
|
print(body)
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -57,6 +57,7 @@ grab={
|
|||||||
|
|
||||||
2d_physics/layer_1="impact"
|
2d_physics/layer_1="impact"
|
||||||
2d_physics/layer_2="freinage"
|
2d_physics/layer_2="freinage"
|
||||||
|
2d_physics/layer_3="déclencheurs"
|
||||||
|
|
||||||
[rendering]
|
[rendering]
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,13 @@ extends PathFollow2D
|
|||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
|
if car == null:
|
||||||
|
return
|
||||||
|
if (delta > 0.01):
|
||||||
|
return
|
||||||
if position.distance_to(car.position) < distanceMax:
|
if position.distance_to(car.position) < distanceMax:
|
||||||
progress += car.speed * delta
|
progress += car.speed * delta
|
||||||
if progress_ratio > 1:
|
if progress_ratio > 1:
|
||||||
progress_ratio = progress_ratio - 1
|
progress_ratio = progress_ratio - 1
|
||||||
if progress_ratio > 0:
|
if progress > 0:
|
||||||
car.moveTo(position);
|
car.moveTo(position);
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
[gd_scene load_steps=12 format=3 uid="uid://b4ydi1vv8dvwr"]
|
[gd_scene load_steps=7 format=3 uid="uid://b4ydi1vv8dvwr"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://d1oqt6sbjvopi" path="res://maps/world.tscn" id="1_6vs81"]
|
[ext_resource type="PackedScene" uid="uid://d1oqt6sbjvopi" path="res://maps/world.tscn" id="1_6vs81"]
|
||||||
[ext_resource type="PackedScene" uid="uid://vclpg4e4ql54" path="res://caracters/player/player.tscn" id="2_5x6b5"]
|
[ext_resource type="PackedScene" uid="uid://vclpg4e4ql54" path="res://caracters/player/player.tscn" id="2_5x6b5"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cl201baro5y5" path="res://vehicules/npc_car.tscn" id="3_yuakw"]
|
[ext_resource type="PackedScene" uid="uid://cl201baro5y5" path="res://vehicules/npc_car.tscn" id="3_yuakw"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bt1p311rn1h6q" path="res://vehicules/car.tscn" id="4_bqm78"]
|
[ext_resource type="PackedScene" uid="uid://bt1p311rn1h6q" path="res://vehicules/car.tscn" id="4_bqm78"]
|
||||||
[ext_resource type="PackedScene" uid="uid://drwmmg2b6nlih" path="res://urban_furnitures/facing_south/high_road_sign.tscn" id="5_3rm0b"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://c6nlrmhu8362v" path="res://urban_furnitures/facing_south/high_semaphore.tscn" id="6_xgcq1"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://bmunphhwcsl3a" path="res://urban_furnitures/facing_north/high_semaphore.tscn" id="7_5gfx2"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://dpyadhlqawviq" path="res://vehicules/brakeZone.tscn" id="8_q1enh"]
|
|
||||||
|
|
||||||
[sub_resource type="Curve2D" id="Curve2D_shblg"]
|
[sub_resource type="Curve2D" id="Curve2D_shblg"]
|
||||||
_data = {
|
_data = {
|
||||||
@@ -21,9 +17,6 @@ _data = {
|
|||||||
}
|
}
|
||||||
point_count = 22
|
point_count = 22
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_tmewa"]
|
|
||||||
size = Vector2(79, 94)
|
|
||||||
|
|
||||||
[node name="scene1" type="Node2D"]
|
[node name="scene1" type="Node2D"]
|
||||||
|
|
||||||
[node name="monde" parent="." instance=ExtResource("1_6vs81")]
|
[node name="monde" parent="." instance=ExtResource("1_6vs81")]
|
||||||
@@ -60,31 +53,4 @@ distanceMax = 150
|
|||||||
|
|
||||||
[node name="Car" parent="movibles/cars/Path2D2" instance=ExtResource("4_bqm78")]
|
[node name="Car" parent="movibles/cars/Path2D2" instance=ExtResource("4_bqm78")]
|
||||||
position = Vector2(803, 1558)
|
position = Vector2(803, 1558)
|
||||||
speed = 400
|
speed = 500
|
||||||
|
|
||||||
[node name="statics" type="Node2D" parent="."]
|
|
||||||
position = Vector2(690, -8)
|
|
||||||
|
|
||||||
[node name="roadSign1" parent="statics" instance=ExtResource("5_3rm0b")]
|
|
||||||
position = Vector2(-1538, 118)
|
|
||||||
|
|
||||||
[node name="roadSign2" parent="statics" instance=ExtResource("5_3rm0b")]
|
|
||||||
position = Vector2(9, -1201)
|
|
||||||
|
|
||||||
[node name="Sempahore" parent="." node_paths=PackedStringArray("dependantSemaphore") instance=ExtResource("6_xgcq1")]
|
|
||||||
position = Vector2(160, -14)
|
|
||||||
dependantSemaphore = NodePath("../Semaphore2")
|
|
||||||
|
|
||||||
[node name="Semaphore2" parent="." instance=ExtResource("7_5gfx2")]
|
|
||||||
position = Vector2(-94, 258)
|
|
||||||
hasOwnTimerEnabled = false
|
|
||||||
|
|
||||||
[node name="brakeZones" type="Node2D" parent="."]
|
|
||||||
|
|
||||||
[node name="Area2D" parent="brakeZones" instance=ExtResource("8_q1enh")]
|
|
||||||
position = Vector2(1016, 59)
|
|
||||||
fullStop = false
|
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="brakeZones/Area2D"]
|
|
||||||
position = Vector2(-9.5, 6)
|
|
||||||
shape = SubResource("RectangleShape2D_tmewa")
|
|
||||||
|
|||||||
70
urban_furnitures/semaphores/down_pedestrian_semaphore.tscn
Normal file
70
urban_furnitures/semaphores/down_pedestrian_semaphore.tscn
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
[gd_scene load_steps=8 format=3 uid="uid://bmunphhwcsl3a"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://urban_furnitures/semaphores/high_semaphore.gd" id="2_nih7h"]
|
||||||
|
[ext_resource type="TileSet" uid="uid://ckj00wy20rkfx" path="res://assest/tilesets/exterieur.tres" id="3_ulyk6"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://brh7cqaxc13ie" path="res://zindex/ZIndexControler.tscn" id="4_k52t8"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://dpyadhlqawviq" path="res://vehicules/brakeZone.tscn" id="5_o0gjx"]
|
||||||
|
|
||||||
|
[sub_resource type="CircleShape2D" id="CircleShape2D_4c8ro"]
|
||||||
|
radius = 15.0
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_36vt6"]
|
||||||
|
size = Vector2(20, 3)
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_y0214"]
|
||||||
|
size = Vector2(200, 95.5)
|
||||||
|
|
||||||
|
[node name="Node2D" type="Node2D"]
|
||||||
|
script = ExtResource("2_nih7h")
|
||||||
|
|
||||||
|
[node name="Sempahore" type="StaticBody2D" parent="."]
|
||||||
|
|
||||||
|
[node name="abovePart" type="TileMapLayer" parent="Sempahore"]
|
||||||
|
z_index = 2000
|
||||||
|
tile_set = ExtResource("3_ulyk6")
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Sempahore"]
|
||||||
|
position = Vector2(20, -15)
|
||||||
|
shape = SubResource("CircleShape2D_4c8ro")
|
||||||
|
|
||||||
|
[node name="pylon" type="TileMapLayer" parent="Sempahore"]
|
||||||
|
tile_map_data = PackedByteArray(0, 0, 0, 0, 253, 255, 4, 0, 20, 0, 10, 0, 0, 0, 0, 0, 254, 255, 4, 0, 20, 0, 11, 0, 0, 0, 0, 0, 255, 255, 4, 0, 20, 0, 12, 0, 0, 0, 0, 0, 251, 255, 4, 0, 20, 0, 8, 0, 0, 0, 0, 0, 252, 255, 4, 0, 20, 0, 9, 0, 0, 0)
|
||||||
|
tile_set = ExtResource("3_ulyk6")
|
||||||
|
|
||||||
|
[node name="red" type="TileMapLayer" parent="Sempahore"]
|
||||||
|
tile_map_data = PackedByteArray(0, 0, 0, 0, 252, 255, 4, 0, 18, 0, 16, 0, 0, 0, 0, 0, 251, 255, 4, 0, 18, 0, 15, 0, 0, 0, 0, 0, 253, 255, 4, 0, 18, 0, 17, 0, 0, 0, 0, 0, 254, 255, 4, 0, 18, 0, 18, 0, 0, 0)
|
||||||
|
tile_set = ExtResource("3_ulyk6")
|
||||||
|
|
||||||
|
[node name="yellow" type="TileMapLayer" parent="Sempahore"]
|
||||||
|
tile_map_data = PackedByteArray(0, 0, 0, 0, 252, 255, 4, 0, 18, 0, 16, 0, 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, 254, 255, 4, 0, 18, 0, 18, 0, 0, 0)
|
||||||
|
tile_set = ExtResource("3_ulyk6")
|
||||||
|
|
||||||
|
[node name="green" type="TileMapLayer" parent="Sempahore"]
|
||||||
|
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")
|
||||||
|
|
||||||
|
[node name="ZIndexControler" parent="." instance=ExtResource("4_k52t8")]
|
||||||
|
position = Vector2(-2, 6)
|
||||||
|
|
||||||
|
[node name="ShapeCast2D" type="ShapeCast2D" parent="ZIndexControler"]
|
||||||
|
position = Vector2(21, -15)
|
||||||
|
shape = SubResource("RectangleShape2D_36vt6")
|
||||||
|
target_position = Vector2(2, -209)
|
||||||
|
|
||||||
|
[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("5_o0gjx")]
|
||||||
|
|
||||||
|
[node name="CollisionShape2D2" type="CollisionShape2D" parent="brakeZone"]
|
||||||
|
position = Vector2(95, -146)
|
||||||
|
rotation = 1.5708
|
||||||
|
shape = SubResource("RectangleShape2D_y0214")
|
||||||
|
|
||||||
|
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]
|
||||||
@@ -3,7 +3,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/abovePart/green, $Sempahore/abovePart/yellow, $Sempahore/abovePart/red ];
|
@onready var lights := [$Sempahore/green, $Sempahore/yellow, $Sempahore/red ];
|
||||||
var light = 0;
|
var light = 0;
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
[gd_scene load_steps=8 format=4 uid="uid://c6nlrmhu8362v"]
|
[gd_scene load_steps=8 format=4 uid="uid://c6nlrmhu8362v"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://urban_furnitures/high_semaphore.gd" id="1_1ufoq"]
|
[ext_resource type="Script" path="res://urban_furnitures/semaphores/high_semaphore.gd" id="1_1ufoq"]
|
||||||
[ext_resource type="TileSet" uid="uid://ckj00wy20rkfx" path="res://assest/tilesets/exterieur.tres" id="1_03yma"]
|
[ext_resource type="TileSet" uid="uid://ckj00wy20rkfx" path="res://assest/tilesets/exterieur.tres" id="1_03yma"]
|
||||||
[ext_resource type="PackedScene" uid="uid://brh7cqaxc13ie" path="res://zindex/ZIndexControler.tscn" id="2_hhwk3"]
|
[ext_resource type="PackedScene" uid="uid://brh7cqaxc13ie" path="res://zindex/ZIndexControler.tscn" id="2_hhwk3"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dpyadhlqawviq" path="res://vehicules/brakeZone.tscn" id="4_j5rhp"]
|
[ext_resource type="PackedScene" uid="uid://dpyadhlqawviq" path="res://vehicules/brakeZone.tscn" id="4_j5rhp"]
|
||||||
@@ -24,21 +24,6 @@ z_index = 2000
|
|||||||
tile_map_data = PackedByteArray("AAD9//3/BAAQAH8AAAD+//z/BAARAH4AAAD+//3/BAARAH8AAAD///v/BAASAH0AAAD///z/BAASAH4AAAD///3/BAASAH8AAAAAAPv/BAATAH0AAAAAAPz/BAATAH4AAAA=")
|
tile_map_data = PackedByteArray("AAD9//3/BAAQAH8AAAD+//z/BAARAH4AAAD+//3/BAARAH8AAAD///v/BAASAH0AAAD///z/BAASAH4AAAD///3/BAASAH8AAAAAAPv/BAATAH0AAAAAAPz/BAATAH4AAAA=")
|
||||||
tile_set = ExtResource("1_03yma")
|
tile_set = ExtResource("1_03yma")
|
||||||
|
|
||||||
[node name="red" type="TileMapLayer" parent="Sempahore/abovePart"]
|
|
||||||
z_index = 2000
|
|
||||||
tile_map_data = PackedByteArray("AAD+//3/BAAOAH0AAAD+//7/BAAOAH4AAAD///3/BAAPAH0AAAA=")
|
|
||||||
tile_set = ExtResource("1_03yma")
|
|
||||||
|
|
||||||
[node name="yellow" type="TileMapLayer" parent="Sempahore/abovePart"]
|
|
||||||
z_index = 2000
|
|
||||||
tile_map_data = PackedByteArray("AAD+//3/BAAOAH8AAAD+//7/BAAOAIAAAAD///3/BAAPAH8AAAA=")
|
|
||||||
tile_set = ExtResource("1_03yma")
|
|
||||||
|
|
||||||
[node name="green" type="TileMapLayer" parent="Sempahore/abovePart"]
|
|
||||||
z_index = 2000
|
|
||||||
tile_map_data = PackedByteArray("AAD+//3/BAAOAIEAAAD+//7/BAAOAIIAAAD///3/BAAPAIEAAAA=")
|
|
||||||
tile_set = ExtResource("1_03yma")
|
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Sempahore"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Sempahore"]
|
||||||
position = Vector2(20, -15)
|
position = Vector2(20, -15)
|
||||||
shape = SubResource("CircleShape2D_4c8ro")
|
shape = SubResource("CircleShape2D_4c8ro")
|
||||||
@@ -55,6 +40,21 @@ position = Vector2(21, -15)
|
|||||||
shape = SubResource("RectangleShape2D_36vt6")
|
shape = SubResource("RectangleShape2D_36vt6")
|
||||||
target_position = Vector2(-2, -125)
|
target_position = Vector2(-2, -125)
|
||||||
|
|
||||||
|
[node name="red" type="TileMapLayer" parent="Sempahore"]
|
||||||
|
z_index = 2000
|
||||||
|
tile_map_data = PackedByteArray("AAD+//3/BAAOAH0AAAD+//7/BAAOAH4AAAD///3/BAAPAH0AAAA=")
|
||||||
|
tile_set = ExtResource("1_03yma")
|
||||||
|
|
||||||
|
[node name="yellow" type="TileMapLayer" parent="Sempahore"]
|
||||||
|
z_index = 2000
|
||||||
|
tile_map_data = PackedByteArray("AAD+//3/BAAOAH8AAAD+//7/BAAOAIAAAAD///3/BAAPAH8AAAA=")
|
||||||
|
tile_set = ExtResource("1_03yma")
|
||||||
|
|
||||||
|
[node name="green" type="TileMapLayer" parent="Sempahore"]
|
||||||
|
z_index = 2000
|
||||||
|
tile_map_data = PackedByteArray("AAD+//3/BAAOAIEAAAD+//7/BAAOAIIAAAD///3/BAAPAIEAAAA=")
|
||||||
|
tile_set = ExtResource("1_03yma")
|
||||||
|
|
||||||
[node name="brakeZone" parent="." instance=ExtResource("4_j5rhp")]
|
[node name="brakeZone" parent="." instance=ExtResource("4_j5rhp")]
|
||||||
|
|
||||||
[node name="CollisionShape2D3" type="CollisionShape2D" parent="brakeZone"]
|
[node name="CollisionShape2D3" type="CollisionShape2D" parent="brakeZone"]
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
[gd_scene load_steps=8 format=4 uid="uid://bmunphhwcsl3a"]
|
[gd_scene load_steps=8 format=4 uid="uid://cw3dtiscqueyt"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://urban_furnitures/high_semaphore.gd" id="2_nih7h"]
|
[ext_resource type="Script" path="res://urban_furnitures/semaphores/high_semaphore.gd" id="1_7rvlf"]
|
||||||
[ext_resource type="TileSet" uid="uid://ckj00wy20rkfx" path="res://assest/tilesets/exterieur.tres" id="3_ulyk6"]
|
[ext_resource type="TileSet" uid="uid://ckj00wy20rkfx" path="res://assest/tilesets/exterieur.tres" id="2_jecjm"]
|
||||||
[ext_resource type="PackedScene" uid="uid://brh7cqaxc13ie" path="res://zindex/ZIndexControler.tscn" id="4_k52t8"]
|
[ext_resource type="PackedScene" uid="uid://brh7cqaxc13ie" path="res://zindex/ZIndexControler.tscn" id="3_65epa"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dpyadhlqawviq" path="res://vehicules/brakeZone.tscn" id="5_o0gjx"]
|
[ext_resource type="PackedScene" uid="uid://dpyadhlqawviq" path="res://vehicules/brakeZone.tscn" id="4_cbarg"]
|
||||||
|
|
||||||
[sub_resource type="CircleShape2D" id="CircleShape2D_4c8ro"]
|
[sub_resource type="CircleShape2D" id="CircleShape2D_4c8ro"]
|
||||||
radius = 15.0
|
radius = 15.0
|
||||||
@@ -15,29 +15,14 @@ size = Vector2(20, 3)
|
|||||||
size = Vector2(200, 95.5)
|
size = Vector2(200, 95.5)
|
||||||
|
|
||||||
[node name="Node2D" type="Node2D"]
|
[node name="Node2D" type="Node2D"]
|
||||||
script = ExtResource("2_nih7h")
|
script = ExtResource("1_7rvlf")
|
||||||
|
|
||||||
[node name="Sempahore" type="StaticBody2D" parent="."]
|
[node name="Sempahore" type="StaticBody2D" parent="."]
|
||||||
|
|
||||||
[node name="abovePart" type="TileMapLayer" parent="Sempahore"]
|
[node name="abovePart" type="TileMapLayer" parent="Sempahore"]
|
||||||
z_index = 2000
|
z_index = 2000
|
||||||
tile_map_data = PackedByteArray("AAAAAPv/BAAXAH0AAAAAAPz/BAAXAH4AAAABAPv/BAAYAH0AAAABAPz/BAAYAH4AAAACAPv/BAAZAH0AAAACAPz/BAAZAH4AAAA=")
|
tile_map_data = PackedByteArray("AAAAAPv/BAAXAH0AAAAAAPz/BAAXAH4AAAABAPv/BAAYAH0AAAABAPz/BAAYAH4AAAACAPv/BAAZAH0AAAACAPz/BAAZAH4AAAA=")
|
||||||
tile_set = ExtResource("3_ulyk6")
|
tile_set = ExtResource("2_jecjm")
|
||||||
|
|
||||||
[node name="red" type="TileMapLayer" parent="Sempahore/abovePart"]
|
|
||||||
z_index = 2000
|
|
||||||
tile_map_data = PackedByteArray("AAABAPv/BAAKAIgAAAABAPz/BAAKAIkAAAACAPv/BAALAIgAAAACAPz/BAALAIkAAAA=")
|
|
||||||
tile_set = ExtResource("3_ulyk6")
|
|
||||||
|
|
||||||
[node name="yellow" type="TileMapLayer" parent="Sempahore/abovePart"]
|
|
||||||
z_index = 2000
|
|
||||||
tile_map_data = PackedByteArray("AAABAPv/BAAKAIgAAAABAPz/BAAKAIkAAAACAPv/BAALAIgAAAACAPz/BAALAIkAAAA=")
|
|
||||||
tile_set = ExtResource("3_ulyk6")
|
|
||||||
|
|
||||||
[node name="green" type="TileMapLayer" parent="Sempahore/abovePart"]
|
|
||||||
z_index = 2000
|
|
||||||
tile_map_data = PackedByteArray("AAABAPv/BAAKAIgAAAABAPz/BAAKAIkAAAACAPv/BAALAIgAAAACAPz/BAALAIkAAAA=")
|
|
||||||
tile_set = ExtResource("3_ulyk6")
|
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Sempahore"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Sempahore"]
|
||||||
position = Vector2(20, -15)
|
position = Vector2(20, -15)
|
||||||
@@ -45,9 +30,9 @@ shape = SubResource("CircleShape2D_4c8ro")
|
|||||||
|
|
||||||
[node name="pylon" type="TileMapLayer" parent="Sempahore"]
|
[node name="pylon" type="TileMapLayer" parent="Sempahore"]
|
||||||
tile_map_data = PackedByteArray("AAAAAP3/BAATAH8AAAAAAP7/BAATAIAAAAAAAP//BAATAIEAAAA=")
|
tile_map_data = PackedByteArray("AAAAAP3/BAATAH8AAAAAAP7/BAATAIAAAAAAAP//BAATAIEAAAA=")
|
||||||
tile_set = ExtResource("3_ulyk6")
|
tile_set = ExtResource("2_jecjm")
|
||||||
|
|
||||||
[node name="ZIndexControler" parent="Sempahore" instance=ExtResource("4_k52t8")]
|
[node name="ZIndexControler" parent="Sempahore" instance=ExtResource("3_65epa")]
|
||||||
position = Vector2(-2, 6)
|
position = Vector2(-2, 6)
|
||||||
|
|
||||||
[node name="ShapeCast2D" type="ShapeCast2D" parent="Sempahore/ZIndexControler"]
|
[node name="ShapeCast2D" type="ShapeCast2D" parent="Sempahore/ZIndexControler"]
|
||||||
@@ -55,6 +40,21 @@ position = Vector2(21, -15)
|
|||||||
shape = SubResource("RectangleShape2D_36vt6")
|
shape = SubResource("RectangleShape2D_36vt6")
|
||||||
target_position = Vector2(-2, -125)
|
target_position = Vector2(-2, -125)
|
||||||
|
|
||||||
|
[node name="red" type="TileMapLayer" parent="Sempahore"]
|
||||||
|
z_index = 2000
|
||||||
|
tile_map_data = PackedByteArray("AAABAPv/BAAKAIgAAAABAPz/BAAKAIkAAAACAPv/BAALAIgAAAACAPz/BAALAIkAAAA=")
|
||||||
|
tile_set = ExtResource("2_jecjm")
|
||||||
|
|
||||||
|
[node name="yellow" type="TileMapLayer" parent="Sempahore"]
|
||||||
|
z_index = 2000
|
||||||
|
tile_map_data = PackedByteArray("AAABAPv/BAAKAIgAAAABAPz/BAAKAIkAAAACAPv/BAALAIgAAAACAPz/BAALAIkAAAA=")
|
||||||
|
tile_set = ExtResource("2_jecjm")
|
||||||
|
|
||||||
|
[node name="green" type="TileMapLayer" parent="Sempahore"]
|
||||||
|
z_index = 2000
|
||||||
|
tile_map_data = PackedByteArray("AAABAPv/BAAKAIgAAAABAPz/BAAKAIkAAAACAPv/BAALAIgAAAACAPz/BAALAIkAAAA=")
|
||||||
|
tile_set = ExtResource("2_jecjm")
|
||||||
|
|
||||||
[node name="Timer" type="Timer" parent="."]
|
[node name="Timer" type="Timer" parent="."]
|
||||||
wait_time = 5.0
|
wait_time = 5.0
|
||||||
one_shot = true
|
one_shot = true
|
||||||
@@ -64,7 +64,7 @@ autostart = true
|
|||||||
offset_right = 40.0
|
offset_right = 40.0
|
||||||
offset_bottom = 23.0
|
offset_bottom = 23.0
|
||||||
|
|
||||||
[node name="brakeZone" parent="." instance=ExtResource("5_o0gjx")]
|
[node name="brakeZone" parent="." instance=ExtResource("4_cbarg")]
|
||||||
|
|
||||||
[node name="CollisionShape2D2" type="CollisionShape2D" parent="brakeZone"]
|
[node name="CollisionShape2D2" type="CollisionShape2D" parent="brakeZone"]
|
||||||
position = Vector2(-75, -75.25)
|
position = Vector2(-75, -75.25)
|
||||||
70
urban_furnitures/semaphores/up_pedestrian_semaphore.tscn
Normal file
70
urban_furnitures/semaphores/up_pedestrian_semaphore.tscn
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
[gd_scene load_steps=8 format=3 uid="uid://dotr3vifbinfy"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://urban_furnitures/semaphores/high_semaphore.gd" id="1_k7vt0"]
|
||||||
|
[ext_resource type="TileSet" uid="uid://ckj00wy20rkfx" path="res://assest/tilesets/exterieur.tres" id="2_iui5y"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://brh7cqaxc13ie" path="res://zindex/ZIndexControler.tscn" id="3_rmo1c"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://dpyadhlqawviq" path="res://vehicules/brakeZone.tscn" id="4_cy22y"]
|
||||||
|
|
||||||
|
[sub_resource type="CircleShape2D" id="CircleShape2D_4c8ro"]
|
||||||
|
radius = 15.0
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_36vt6"]
|
||||||
|
size = Vector2(20, 3)
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_y0214"]
|
||||||
|
size = Vector2(200, 95.5)
|
||||||
|
|
||||||
|
[node name="Node2D" type="Node2D"]
|
||||||
|
script = ExtResource("1_k7vt0")
|
||||||
|
|
||||||
|
[node name="Sempahore" type="StaticBody2D" parent="."]
|
||||||
|
|
||||||
|
[node name="abovePart" type="TileMapLayer" parent="Sempahore"]
|
||||||
|
z_index = 2000
|
||||||
|
tile_set = ExtResource("2_iui5y")
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Sempahore"]
|
||||||
|
position = Vector2(20, -15)
|
||||||
|
shape = SubResource("CircleShape2D_4c8ro")
|
||||||
|
|
||||||
|
[node name="pylon" type="TileMapLayer" parent="Sempahore"]
|
||||||
|
tile_map_data = PackedByteArray(0, 0, 0, 0, 253, 255, 4, 0, 20, 0, 10, 0, 0, 0, 0, 0, 254, 255, 4, 0, 20, 0, 11, 0, 0, 0, 0, 0, 255, 255, 4, 0, 20, 0, 12, 0, 0, 0, 0, 0, 251, 255, 4, 0, 20, 0, 8, 0, 0, 0, 0, 0, 252, 255, 4, 0, 20, 0, 9, 0, 0, 0)
|
||||||
|
tile_set = ExtResource("2_iui5y")
|
||||||
|
|
||||||
|
[node name="red" type="TileMapLayer" parent="Sempahore"]
|
||||||
|
tile_map_data = PackedByteArray(0, 0, 0, 0, 252, 255, 4, 0, 18, 0, 12, 0, 0, 0)
|
||||||
|
tile_set = ExtResource("2_iui5y")
|
||||||
|
|
||||||
|
[node name="yellow" type="TileMapLayer" parent="Sempahore"]
|
||||||
|
tile_map_data = PackedByteArray(0, 0, 0, 0, 252, 255, 4, 0, 17, 0, 12, 0, 0, 0, 0, 0, 253, 255, 4, 0, 17, 0, 13, 0, 0, 0)
|
||||||
|
tile_set = ExtResource("2_iui5y")
|
||||||
|
|
||||||
|
[node name="green" type="TileMapLayer" parent="Sempahore"]
|
||||||
|
tile_map_data = PackedByteArray(0, 0, 0, 0, 253, 255, 4, 0, 16, 0, 13, 0, 0, 0)
|
||||||
|
tile_set = ExtResource("2_iui5y")
|
||||||
|
|
||||||
|
[node name="ZIndexControler" parent="." instance=ExtResource("3_rmo1c")]
|
||||||
|
position = Vector2(-2, 6)
|
||||||
|
|
||||||
|
[node name="ShapeCast2D" type="ShapeCast2D" parent="ZIndexControler"]
|
||||||
|
position = Vector2(21, -15)
|
||||||
|
shape = SubResource("RectangleShape2D_36vt6")
|
||||||
|
target_position = Vector2(2, -209)
|
||||||
|
|
||||||
|
[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_cy22y")]
|
||||||
|
|
||||||
|
[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"]
|
||||||
@@ -34,8 +34,9 @@ func _process(delta: float) -> void:
|
|||||||
current_speed = min(current_speed + acceleration, speed)
|
current_speed = min(current_speed + acceleration, speed)
|
||||||
$ZIndexControler/ShapeCast2D.enabled = !$CollisionHorizontal.disabled
|
$ZIndexControler/ShapeCast2D.enabled = !$CollisionHorizontal.disabled
|
||||||
|
|
||||||
|
|
||||||
if (targetPosition != null):
|
if (targetPosition != null):
|
||||||
velocity = (targetPosition - position) * current_speed * delta;
|
velocity = (targetPosition - position) * current_speed * delta
|
||||||
|
|
||||||
move_and_slide()
|
move_and_slide()
|
||||||
if velocity:
|
if velocity:
|
||||||
|
|||||||
Reference in New Issue
Block a user