From f7fd3f9dacf87e4d6f95aa0fdbb0bdb309bdbc3a Mon Sep 17 00:00:00 2001 From: perivesta <> Date: Sat, 8 Jul 2023 10:18:16 +0200 Subject: move/rename scene --- Nodes/drawing_and_driving.tscn | 3 +++ Nodes/driving_test.tscn | 58 +++++++++++++++++++++++++++++++++++++++++ Scripts/car_behaviour.gd | 2 +- project.godot | 2 +- root_scene.tscn | 59 ------------------------------------------ 5 files changed, 63 insertions(+), 61 deletions(-) create mode 100644 Nodes/drawing_and_driving.tscn create mode 100644 Nodes/driving_test.tscn delete mode 100644 root_scene.tscn diff --git a/Nodes/drawing_and_driving.tscn b/Nodes/drawing_and_driving.tscn new file mode 100644 index 0000000..9e2a36a --- /dev/null +++ b/Nodes/drawing_and_driving.tscn @@ -0,0 +1,3 @@ +[gd_scene format=3 uid="uid://bj5wruvb2hg20"] + +[node name="drawing_and_driving" type="Node2D"] diff --git a/Nodes/driving_test.tscn b/Nodes/driving_test.tscn new file mode 100644 index 0000000..86964c5 --- /dev/null +++ b/Nodes/driving_test.tscn @@ -0,0 +1,58 @@ +[gd_scene load_steps=5 format=3 uid="uid://b205qlgjrpeqi"] + +[ext_resource type="Script" path="res://Scripts/scene_control.gd" id="1_eopk0"] +[ext_resource type="PackedScene" uid="uid://cqglbcitm2wlb" path="res://Nodes/simple_wall.tscn" id="1_o5f4t"] +[ext_resource type="PackedScene" uid="uid://c1mvbh2fwqtkb" path="res://Nodes/car.tscn" id="2_22f5l"] + +[sub_resource type="Curve2D" id="Curve2D_rg63l"] +bake_interval = 10.0 +_data = { +"points": PackedVector2Array(0, 0, 0, 0, 500, 61, 0, 0, 0, 0, 421, 8, -17.0089, 38.4276, 17.0089, -38.4276, 606, 37, -18.8988, 13.2292, 18.8988, -13.2292, 634, -114, -31.498, -18.8988, 31.498, 18.8988, 718, -102, 8.18949, -25.8284, -8.18949, 25.8284, 720, 263, 26.4583, 13.2292, -26.4583, -13.2292, 639, 286, 0, 0, 0, 0, 400, 152, 0, 0, 0, 0, 646, 194, 46.6171, 22.6786, -46.6171, -22.6786, 537, 118, 0, 0, 0, 0, 369, 136, -3.1498, 47.247, 3.1498, -47.247, 312, 90, 0, 0, 0, 0, 358, 16, 0, 0, 0, 0, 378, 42) +} +point_count = 14 + +[node name="Node2D" type="Node2D"] +position = Vector2(0, 1) +script = ExtResource("1_eopk0") + +[node name="SimpleWall" parent="." instance=ExtResource("1_o5f4t")] +position = Vector2(520, 240) + +[node name="SimpleWall10" parent="." instance=ExtResource("1_o5f4t")] +position = Vector2(645, -4) + +[node name="SimpleWall8" parent="." instance=ExtResource("1_o5f4t")] +position = Vector2(427, 139) + +[node name="SimpleWall7" parent="." instance=ExtResource("1_o5f4t")] +position = Vector2(236, 321) + +[node name="SimpleWall6" parent="." instance=ExtResource("1_o5f4t")] +position = Vector2(494, 417) +rotation = 0.716721 + +[node name="SimpleWall4" parent="." instance=ExtResource("1_o5f4t")] +position = Vector2(618, 493) + +[node name="SimpleWall2" parent="." instance=ExtResource("1_o5f4t")] +position = Vector2(680, 235) +scale = Vector2(1.28, 16.6) + +[node name="SimpleWall3" parent="." instance=ExtResource("1_o5f4t")] +position = Vector2(762, 238) +scale = Vector2(1.28, 27.28) + +[node name="SimpleWall9" parent="." instance=ExtResource("1_o5f4t")] +position = Vector2(581, -122) +scale = Vector2(1.28, 27.28) + +[node name="SimpleWall5" parent="." instance=ExtResource("1_o5f4t")] +position = Vector2(273, 258) +scale = Vector2(1.28, 27.28) + +[node name="Path2D" type="Path2D" parent="."] +position = Vector2(0, 147) +curve = SubResource("Curve2D_rg63l") + +[node name="Car" parent="." instance=ExtResource("2_22f5l")] +position = Vector2(390, 202) diff --git a/Scripts/car_behaviour.gd b/Scripts/car_behaviour.gd index c90fe05..b71ebb6 100644 --- a/Scripts/car_behaviour.gd +++ b/Scripts/car_behaviour.gd @@ -1,7 +1,7 @@ extends StaticBody2D # editor variables -@export var max_speed = 3500 +@export var max_speed = 300 @export var steer_force = 0.1 @export var look_ahead = 75 @export var num_rays = 32 diff --git a/project.godot b/project.godot index 703acfd..7531777 100644 --- a/project.godot +++ b/project.godot @@ -11,7 +11,7 @@ config_version=5 [application] config/name="CodeWithYourFriends23" -run/main_scene="res://root_scene.tscn" +run/main_scene="res://Nodes/driving_test.tscn" config/features=PackedStringArray("4.0", "Forward Plus") config/icon="res://icon.svg" diff --git a/root_scene.tscn b/root_scene.tscn deleted file mode 100644 index 12d5bba..0000000 --- a/root_scene.tscn +++ /dev/null @@ -1,59 +0,0 @@ -[gd_scene load_steps=5 format=3 uid="uid://b205qlgjrpeqi"] - -[ext_resource type="Script" path="res://Scripts/scene_control.gd" id="1_eopk0"] -[ext_resource type="PackedScene" uid="uid://cqglbcitm2wlb" path="res://Nodes/simple_wall.tscn" id="1_o5f4t"] -[ext_resource type="PackedScene" uid="uid://c1mvbh2fwqtkb" path="res://Nodes/car.tscn" id="2_22f5l"] - -[sub_resource type="Curve2D" id="Curve2D_rg63l"] -bake_interval = 10.0 -_data = { -"points": PackedVector2Array(0, 0, 0, 0, 500, 61, 0, 0, 0, 0, 421, 8, -17.0089, 38.4276, 17.0089, -38.4276, 606, 37, -18.8988, 13.2292, 18.8988, -13.2292, 634, -114, -31.498, -18.8988, 31.498, 18.8988, 718, -102, 8.18949, -25.8284, -8.18949, 25.8284, 720, 263, 26.4583, 13.2292, -26.4583, -13.2292, 639, 286, 0, 0, 0, 0, 400, 152, 0, 0, 0, 0, 646, 194, 46.6171, 22.6786, -46.6171, -22.6786, 537, 118, 0, 0, 0, 0, 369, 136, -3.1498, 47.247, 3.1498, -47.247, 312, 90, 0, 0, 0, 0, 358, 16, 0, 0, 0, 0, 378, 42) -} -point_count = 14 - -[node name="Node2D" type="Node2D"] -position = Vector2(0, 1) -script = ExtResource("1_eopk0") - -[node name="SimpleWall" parent="." instance=ExtResource("1_o5f4t")] -position = Vector2(520, 240) - -[node name="SimpleWall10" parent="." instance=ExtResource("1_o5f4t")] -position = Vector2(645, -4) - -[node name="SimpleWall8" parent="." instance=ExtResource("1_o5f4t")] -position = Vector2(427, 139) - -[node name="SimpleWall7" parent="." instance=ExtResource("1_o5f4t")] -position = Vector2(236, 321) - -[node name="SimpleWall6" parent="." instance=ExtResource("1_o5f4t")] -position = Vector2(494, 417) -rotation = 0.716721 - -[node name="SimpleWall4" parent="." instance=ExtResource("1_o5f4t")] -position = Vector2(618, 493) - -[node name="SimpleWall2" parent="." instance=ExtResource("1_o5f4t")] -position = Vector2(680, 235) -scale = Vector2(1.28, 16.6) - -[node name="SimpleWall3" parent="." instance=ExtResource("1_o5f4t")] -position = Vector2(762, 238) -scale = Vector2(1.28, 27.28) - -[node name="SimpleWall9" parent="." instance=ExtResource("1_o5f4t")] -position = Vector2(581, -122) -scale = Vector2(1.28, 27.28) - -[node name="SimpleWall5" parent="." instance=ExtResource("1_o5f4t")] -position = Vector2(273, 258) -scale = Vector2(1.28, 27.28) - -[node name="Path2D" type="Path2D" parent="."] -position = Vector2(0, 147) -curve = SubResource("Curve2D_rg63l") - -[node name="Car" parent="." instance=ExtResource("2_22f5l")] -position = Vector2(390, 202) -max_speed = 100 -- cgit