Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 6 additions & 115 deletions scenes/main.tscn
Original file line number Diff line number Diff line change
@@ -1,67 +1,13 @@
[gd_scene load_steps=22 format=3 uid="uid://clq7nox1juh3a"]
[gd_scene load_steps=9 format=3 uid="uid://clq7nox1juh3a"]

[ext_resource type="Environment" uid="uid://c3bs0wfxpri8g" path="res://scenes/main-environment.tres" id="1_q4t1r"]
[ext_resource type="Script" uid="uid://bqite16pastgo" path="res://scripts/vehicle.gd" id="2_xjb8m"]
[ext_resource type="Texture2D" uid="uid://c026qrhqxgw3n" path="res://sprites/smoke.png" id="4_h8cj5"]
[ext_resource type="PackedScene" uid="uid://bynb5jk1d478y" path="res://models/vehicle-truck-yellow.glb" id="4_ya4ey"]
[ext_resource type="PackedScene" uid="uid://badoy1c127yhf" path="res://scenes/vehicle.tscn" id="2_o6xl0"]
[ext_resource type="Script" uid="uid://b24bstassw26s" path="res://scripts/view.gd" id="5_0lrhn"]
[ext_resource type="AudioStream" uid="uid://2in1jtv5bh0y" path="res://audio/skid.ogg" id="5_choun"]
[ext_resource type="AudioStream" uid="uid://j6x2is8pyt8y" path="res://audio/engine.ogg" id="6_choun"]
[ext_resource type="MeshLibrary" uid="uid://b6myd2b7l2o2j" path="res://models/Library/mesh-library.tres" id="8_eg7gk"]
[ext_resource type="PackedScene" uid="uid://c44tfiddyjjm1" path="res://models/vehicle-truck-green.glb" id="9_cmq2j"]
[ext_resource type="PackedScene" uid="uid://c5e64mpylh1ge" path="res://models/vehicle-truck-purple.glb" id="10_p3c1o"]
[ext_resource type="PackedScene" uid="uid://b34e2pvbemfac" path="res://models/vehicle-truck-red.glb" id="11_wocnk"]

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_tfk12"]
transparency = 1
depth_draw_mode = 2
shading_mode = 0
vertex_color_use_as_albedo = true
albedo_texture = ExtResource("4_h8cj5")
disable_receive_shadows = true
billboard_mode = 3
billboard_keep_scale = true
particles_anim_h_frames = 1
particles_anim_v_frames = 1
particles_anim_loop = false
grow_amount = 0.5
proximity_fade_enabled = true
proximity_fade_distance = 0.25

[sub_resource type="Curve" id="Curve_t02a3"]
_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(0.503968, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 3

[sub_resource type="CurveTexture" id="CurveTexture_mya1o"]
curve = SubResource("Curve_t02a3")

[sub_resource type="Curve" id="Curve_bncg7"]
_data = [Vector2(0, 0.5), 0.0, 0.0, 0, 0, Vector2(0.5, 1), 0.0, 0.0, 0, 0, Vector2(1, 0.2), 0.5, 0.0, 0, 0]
point_count = 3

[sub_resource type="CurveTexture" id="CurveTexture_5pp1o"]
curve = SubResource("Curve_bncg7")

[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_xgt35"]
angle_min = -90.0
angle_max = 90.0
gravity = Vector3(0, 0, 0)
damping_min = 1.0
damping_max = 1.0
scale_min = 0.25
scale_max = 0.5
scale_curve = SubResource("CurveTexture_5pp1o")
color = Color(0.3696, 0.3738, 0.42, 1)
alpha_curve = SubResource("CurveTexture_mya1o")

[sub_resource type="QuadMesh" id="QuadMesh_68fxn"]

[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_eyo0u"]
friction = 5.0
rough = true

[sub_resource type="SphereShape3D" id="SphereShape3D_hhncp"]

[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_tipki"]
friction = 0.0
bounce = 0.1
Expand All @@ -71,73 +17,18 @@ bounce = 0.1
[node name="Environment" type="WorldEnvironment" parent="."]
environment = ExtResource("1_q4t1r")

[node name="Vehicle" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.5, 0, 5)
script = ExtResource("2_xjb8m")

[node name="Ground" type="RayCast3D" parent="Vehicle"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
target_position = Vector3(0, -0.7, 0)
hit_back_faces = false
debug_shape_custom_color = Color(0.898039, 0, 0, 1)

[node name="Container" type="Node3D" parent="Vehicle"]

[node name="Model" parent="Vehicle/Container" instance=ExtResource("4_ya4ey")]

[node name="TrailLeft" type="GPUParticles3D" parent="Vehicle/Container"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.25, 0.05, -0.35)
material_override = SubResource("StandardMaterial3D_tfk12")
cast_shadow = 0
amount = 32
lifetime = 0.5
fixed_fps = 60
process_material = SubResource("ParticleProcessMaterial_xgt35")
draw_pass_1 = SubResource("QuadMesh_68fxn")

[node name="TrailRight" type="GPUParticles3D" parent="Vehicle/Container"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.25, 0.05, -0.35)
material_override = SubResource("StandardMaterial3D_tfk12")
cast_shadow = 0
amount = 32
lifetime = 0.5
fixed_fps = 60
process_material = SubResource("ParticleProcessMaterial_xgt35")
draw_pass_1 = SubResource("QuadMesh_68fxn")

[node name="ScreechSound" type="AudioStreamPlayer3D" parent="Vehicle/Container"]
stream = ExtResource("5_choun")
autoplay = true

[node name="EngineSound" type="AudioStreamPlayer3D" parent="Vehicle/Container"]
stream = ExtResource("6_choun")
autoplay = true

[node name="Sphere" type="RigidBody3D" parent="Vehicle"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
collision_layer = 8
mass = 1000.0
physics_material_override = SubResource("PhysicsMaterial_eyo0u")
gravity_scale = 1.5
continuous_cd = true
contact_monitor = true
max_contacts_reported = 1
linear_damp = 0.1
angular_damp_mode = 1
angular_damp = 4.0

[node name="CollisionShape" type="CollisionShape3D" parent="Vehicle/Sphere"]
shape = SubResource("SphereShape3D_hhncp")

[node name="Plane" type="CSGBox3D" parent="."]
transparency = 1.0
use_collision = true
size = Vector3(60, 0, 60)

[node name="Vehicle" parent="." instance=ExtResource("2_o6xl0")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.5, 0, 5)

[node name="View" type="Node3D" parent="." node_paths=PackedStringArray("target")]
transform = Transform3D(0.707107, -0.40558, 0.579228, 0, 0.819152, 0.573576, -0.707107, -0.40558, 0.579228, 3.5, 0, 5)
script = ExtResource("5_0lrhn")
target = NodePath("../Vehicle/Container")
target = NodePath("../Vehicle")

[node name="Camera" type="Camera3D" parent="View"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 16)
Expand Down
128 changes: 128 additions & 0 deletions scenes/vehicle.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
[gd_scene load_steps=15 format=3 uid="uid://badoy1c127yhf"]

[ext_resource type="Script" uid="uid://bqite16pastgo" path="res://scripts/vehicle.gd" id="1_6gcpt"]
[ext_resource type="PackedScene" uid="uid://bynb5jk1d478y" path="res://models/vehicle-truck-yellow.glb" id="2_e2g1l"]
[ext_resource type="Texture2D" uid="uid://c026qrhqxgw3n" path="res://sprites/smoke.png" id="3_vuxys"]
[ext_resource type="AudioStream" uid="uid://2in1jtv5bh0y" path="res://audio/skid.ogg" id="4_p2hth"]
[ext_resource type="AudioStream" uid="uid://j6x2is8pyt8y" path="res://audio/engine.ogg" id="5_mcce1"]

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_tfk12"]
transparency = 1
depth_draw_mode = 2
shading_mode = 0
vertex_color_use_as_albedo = true
albedo_texture = ExtResource("3_vuxys")
disable_receive_shadows = true
billboard_mode = 3
billboard_keep_scale = true
particles_anim_h_frames = 1
particles_anim_v_frames = 1
particles_anim_loop = false
grow_amount = 0.5
proximity_fade_enabled = true
proximity_fade_distance = 0.25

[sub_resource type="Curve" id="Curve_t02a3"]
_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(0.503968, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 3

[sub_resource type="CurveTexture" id="CurveTexture_mya1o"]
curve = SubResource("Curve_t02a3")

[sub_resource type="Curve" id="Curve_bncg7"]
_data = [Vector2(0, 0.5), 0.0, 0.0, 0, 0, Vector2(0.5, 1), 0.0, 0.0, 0, 0, Vector2(1, 0.2), 0.5, 0.0, 0, 0]
point_count = 3

[sub_resource type="CurveTexture" id="CurveTexture_5pp1o"]
curve = SubResource("Curve_bncg7")

[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_xgt35"]
angle_min = -90.0
angle_max = 90.0
gravity = Vector3(0, 0, 0)
damping_min = 1.0
damping_max = 1.0
scale_min = 0.25
scale_max = 0.5
scale_curve = SubResource("CurveTexture_5pp1o")
color = Color(0.3696, 0.3738, 0.42, 1)
alpha_curve = SubResource("CurveTexture_mya1o")

[sub_resource type="QuadMesh" id="QuadMesh_68fxn"]

[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_eyo0u"]
friction = 5.0
rough = true

[sub_resource type="SphereShape3D" id="SphereShape3D_hhncp"]

[node name="Vehicle" type="Node3D" node_paths=PackedStringArray("sphere", "raycast", "vehicle_model", "vehicle_body", "wheel_fl", "wheel_fr", "wheel_bl", "wheel_br", "trail_left", "trail_right", "screech_sound", "engine_sound")]
script = ExtResource("1_6gcpt")
sphere = NodePath("Sphere")
raycast = NodePath("Ground")
vehicle_model = NodePath("Container")
vehicle_body = NodePath("Container/Model/body")
wheel_fl = NodePath("Container/Model/wheel-front-left")
wheel_fr = NodePath("Container/Model/wheel-front-right")
wheel_bl = NodePath("Container/Model/wheel-back-left")
wheel_br = NodePath("Container/Model/wheel-back-right")
trail_left = NodePath("Container/TrailLeft")
trail_right = NodePath("Container/TrailRight")
screech_sound = NodePath("Container/ScreechSound")
engine_sound = NodePath("Container/EngineSound")

[node name="Ground" type="RayCast3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
target_position = Vector3(0, -0.7, 0)
hit_back_faces = false
debug_shape_custom_color = Color(0.898039, 0, 0, 1)

[node name="Container" type="Node3D" parent="."]

[node name="Model" parent="Container" instance=ExtResource("2_e2g1l")]

[node name="TrailLeft" type="GPUParticles3D" parent="Container"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.25, 0.05, -0.35)
material_override = SubResource("StandardMaterial3D_tfk12")
cast_shadow = 0
amount = 32
lifetime = 0.5
fixed_fps = 60
process_material = SubResource("ParticleProcessMaterial_xgt35")
draw_pass_1 = SubResource("QuadMesh_68fxn")

[node name="TrailRight" type="GPUParticles3D" parent="Container"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.25, 0.05, -0.35)
material_override = SubResource("StandardMaterial3D_tfk12")
cast_shadow = 0
amount = 32
lifetime = 0.5
fixed_fps = 60
process_material = SubResource("ParticleProcessMaterial_xgt35")
draw_pass_1 = SubResource("QuadMesh_68fxn")

[node name="ScreechSound" type="AudioStreamPlayer3D" parent="Container"]
stream = ExtResource("4_p2hth")
autoplay = true

[node name="EngineSound" type="AudioStreamPlayer3D" parent="Container"]
stream = ExtResource("5_mcce1")
autoplay = true

[node name="Sphere" type="RigidBody3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
collision_layer = 8
mass = 1000.0
physics_material_override = SubResource("PhysicsMaterial_eyo0u")
gravity_scale = 1.5
continuous_cd = true
contact_monitor = true
max_contacts_reported = 1
linear_damp = 0.1
angular_damp_mode = 1
angular_damp = 4.0

[node name="CollisionShape" type="CollisionShape3D" parent="Sphere"]
shape = SubResource("SphereShape3D_hhncp")

[editable path="Container/Model"]
Loading