summaryrefslogtreecommitdiff
path: root/game.tscn
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-06-05 00:36:03 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-06-05 00:36:03 +0200
commit2a81306abc47e94c7ffd5173a031baf36bbfcc24 (patch)
treecf0175a26984e616f762055e2374db73e137849a /game.tscn
parent9c918c4a04a656f1017955bcb772ae8ce7c61089 (diff)
downloadcar-2a81306abc47e94c7ffd5173a031baf36bbfcc24.tar.gz
Implement camera and ball
Diffstat (limited to 'game.tscn')
-rw-r--r--game.tscn146
1 files changed, 63 insertions, 83 deletions
diff --git a/game.tscn b/game.tscn
index 44b4923..19d4749 100644
--- a/game.tscn
+++ b/game.tscn
@@ -1,105 +1,85 @@
-[gd_scene load_steps=9 format=2]
+[gd_scene load_steps=11 format=2]
-[ext_resource path="res://car.gd" type="Script" id=1]
+[ext_resource path="res://car.tscn" type="PackedScene" id=1]
+[ext_resource path="res://ball.tscn" type="PackedScene" id=2]
-[sub_resource type="SpatialMaterial" id=1]
-albedo_color = Color( 0.298039, 0.235294, 0.235294, 1 )
+[sub_resource type="CubeMesh" id=1]
+size = Vector3( 25, 1, 100 )
-[sub_resource type="CubeMesh" id=2]
-material = SubResource( 1 )
-size = Vector3( 50, 1, 50 )
+[sub_resource type="ConcavePolygonShape" id=2]
+data = PoolVector3Array( -12.5, 0.5, 25, 12.5, 0.5, 25, -12.5, -0.5, 25, 12.5, 0.5, 25, 12.5, -0.5, 25, -12.5, -0.5, 25, 12.5, 0.5, -25, -12.5, 0.5, -25, 12.5, -0.5, -25, -12.5, 0.5, -25, -12.5, -0.5, -25, 12.5, -0.5, -25, 12.5, 0.5, 25, 12.5, 0.5, -25, 12.5, -0.5, 25, 12.5, 0.5, -25, 12.5, -0.5, -25, 12.5, -0.5, 25, -12.5, 0.5, -25, -12.5, 0.5, 25, -12.5, -0.5, -25, -12.5, 0.5, 25, -12.5, -0.5, 25, -12.5, -0.5, -25, 12.5, 0.5, 25, -12.5, 0.5, 25, 12.5, 0.5, -25, -12.5, 0.5, 25, -12.5, 0.5, -25, 12.5, 0.5, -25, -12.5, -0.5, 25, 12.5, -0.5, 25, -12.5, -0.5, -25, 12.5, -0.5, 25, 12.5, -0.5, -25, -12.5, -0.5, -25 )
[sub_resource type="ConcavePolygonShape" id=3]
-data = PoolVector3Array( -25, 0.5, 25, 25, 0.5, 25, -25, -0.5, 25, 25, 0.5, 25, 25, -0.5, 25, -25, -0.5, 25, 25, 0.5, -25, -25, 0.5, -25, 25, -0.5, -25, -25, 0.5, -25, -25, -0.5, -25, 25, -0.5, -25, 25, 0.5, 25, 25, 0.5, -25, 25, -0.5, 25, 25, 0.5, -25, 25, -0.5, -25, 25, -0.5, 25, -25, 0.5, -25, -25, 0.5, 25, -25, -0.5, -25, -25, 0.5, 25, -25, -0.5, 25, -25, -0.5, -25, 25, 0.5, 25, -25, 0.5, 25, 25, 0.5, -25, -25, 0.5, 25, -25, 0.5, -25, 25, 0.5, -25, -25, -0.5, 25, 25, -0.5, 25, -25, -0.5, -25, 25, -0.5, 25, 25, -0.5, -25, -25, -0.5, -25 )
+data = PoolVector3Array( -12.5, 0.5, 50, 12.5, 0.5, 50, -12.5, -0.5, 50, 12.5, 0.5, 50, 12.5, -0.5, 50, -12.5, -0.5, 50, 12.5, 0.5, -50, -12.5, 0.5, -50, 12.5, -0.5, -50, -12.5, 0.5, -50, -12.5, -0.5, -50, 12.5, -0.5, -50, 12.5, 0.5, 50, 12.5, 0.5, -50, 12.5, -0.5, 50, 12.5, 0.5, -50, 12.5, -0.5, -50, 12.5, -0.5, 50, -12.5, 0.5, -50, -12.5, 0.5, 50, -12.5, -0.5, -50, -12.5, 0.5, 50, -12.5, -0.5, 50, -12.5, -0.5, -50, 12.5, 0.5, 50, -12.5, 0.5, 50, 12.5, 0.5, -50, -12.5, 0.5, 50, -12.5, 0.5, -50, 12.5, 0.5, -50, -12.5, -0.5, 50, 12.5, -0.5, 50, -12.5, -0.5, -50, 12.5, -0.5, 50, 12.5, -0.5, -50, -12.5, -0.5, -50 )
+
+[sub_resource type="ConcavePolygonShape" id=4]
+data = PoolVector3Array( -12.5, 0.5, 50, 12.5, 0.5, 50, -12.5, -0.5, 50, 12.5, 0.5, 50, 12.5, -0.5, 50, -12.5, -0.5, 50, 12.5, 0.5, -50, -12.5, 0.5, -50, 12.5, -0.5, -50, -12.5, 0.5, -50, -12.5, -0.5, -50, 12.5, -0.5, -50, 12.5, 0.5, 50, 12.5, 0.5, -50, 12.5, -0.5, 50, 12.5, 0.5, -50, 12.5, -0.5, -50, 12.5, -0.5, 50, -12.5, 0.5, -50, -12.5, 0.5, 50, -12.5, -0.5, -50, -12.5, 0.5, 50, -12.5, -0.5, 50, -12.5, -0.5, -50, 12.5, 0.5, 50, -12.5, 0.5, 50, 12.5, 0.5, -50, -12.5, 0.5, 50, -12.5, 0.5, -50, 12.5, 0.5, -50, -12.5, -0.5, 50, 12.5, -0.5, 50, -12.5, -0.5, -50, 12.5, -0.5, 50, 12.5, -0.5, -50, -12.5, -0.5, -50 )
-[sub_resource type="CubeMesh" id=4]
-size = Vector3( 1.5, 0.5, 3 )
+[sub_resource type="ConcavePolygonShape" id=5]
+data = PoolVector3Array( -12.5, 0.5, 50, 12.5, 0.5, 50, -12.5, -0.5, 50, 12.5, 0.5, 50, 12.5, -0.5, 50, -12.5, -0.5, 50, 12.5, 0.5, -50, -12.5, 0.5, -50, 12.5, -0.5, -50, -12.5, 0.5, -50, -12.5, -0.5, -50, 12.5, -0.5, -50, 12.5, 0.5, 50, 12.5, 0.5, -50, 12.5, -0.5, 50, 12.5, 0.5, -50, 12.5, -0.5, -50, 12.5, -0.5, 50, -12.5, 0.5, -50, -12.5, 0.5, 50, -12.5, -0.5, -50, -12.5, 0.5, 50, -12.5, -0.5, 50, -12.5, -0.5, -50, 12.5, 0.5, 50, -12.5, 0.5, 50, 12.5, 0.5, -50, -12.5, 0.5, 50, -12.5, 0.5, -50, 12.5, 0.5, -50, -12.5, -0.5, 50, 12.5, -0.5, 50, -12.5, -0.5, -50, 12.5, -0.5, 50, 12.5, -0.5, -50, -12.5, -0.5, -50 )
-[sub_resource type="ConvexPolygonShape" id=5]
-points = PoolVector3Array( -0.7225, -0.25, -1.43083, -0.7225, -0.25, 1.43083, -0.694167, 0.25, -1.37472, -0.694167, 0.25, 1.37472, 0.694167, 0.25, -1.37472, 0.694167, 0.25, 1.37472, 0.7225, -0.25, -1.43083, 0.7225, -0.25, 1.43083 )
+[sub_resource type="SpatialMaterial" id=6]
+albedo_color = Color( 0.298039, 0.235294, 0.235294, 1 )
-[sub_resource type="CylinderMesh" id=6]
-top_radius = 0.4
-bottom_radius = 0.4
-height = 0.25
-radial_segments = 12
+[sub_resource type="CubeMesh" id=7]
+material = SubResource( 6 )
+size = Vector3( 100, 1, 100 )
-[sub_resource type="SpatialMaterial" id=7]
-albedo_color = Color( 0.156863, 0.160784, 0.290196, 1 )
+[sub_resource type="ConcavePolygonShape" id=8]
+data = PoolVector3Array( -50, 0.5, 50, 50, 0.5, 50, -50, -0.5, 50, 50, 0.5, 50, 50, -0.5, 50, -50, -0.5, 50, 50, 0.5, -50, -50, 0.5, -50, 50, -0.5, -50, -50, 0.5, -50, -50, -0.5, -50, 50, -0.5, -50, 50, 0.5, 50, 50, 0.5, -50, 50, -0.5, 50, 50, 0.5, -50, 50, -0.5, -50, 50, -0.5, 50, -50, 0.5, -50, -50, 0.5, 50, -50, -0.5, -50, -50, 0.5, 50, -50, -0.5, 50, -50, -0.5, -50, 50, 0.5, 50, -50, 0.5, 50, 50, 0.5, -50, -50, 0.5, 50, -50, 0.5, -50, 50, 0.5, -50, -50, -0.5, 50, 50, -0.5, 50, -50, -0.5, -50, 50, -0.5, 50, 50, -0.5, -50, -50, -0.5, -50 )
[node name="game" type="Spatial"]
-[node name="ground" type="MeshInstance" parent="."]
-mesh = SubResource( 2 )
+[node name="MeshInstance" type="MeshInstance" parent="."]
+transform = Transform( -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 0, 0, 1, 50.3668, 11.7884, -0.881386 )
+mesh = SubResource( 1 )
material/0 = null
-[node name="StaticBody" type="StaticBody" parent="ground"]
+[node name="StaticBody" type="StaticBody" parent="MeshInstance"]
-[node name="CollisionShape" type="CollisionShape" parent="ground/StaticBody"]
+[node name="CollisionShape" type="CollisionShape" parent="MeshInstance/StaticBody"]
+shape = SubResource( 2 )
+
+[node name="MeshInstance4" type="MeshInstance" parent="."]
+transform = Transform( -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 0, 0, 1, -49.5117, 12, -1 )
+mesh = SubResource( 1 )
+material/0 = null
+
+[node name="StaticBody" type="StaticBody" parent="MeshInstance4"]
+
+[node name="CollisionShape" type="CollisionShape" parent="MeshInstance4/StaticBody"]
shape = SubResource( 3 )
-[node name="car" type="VehicleBody" parent="."]
-transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0 )
-script = ExtResource( 1 )
+[node name="MeshInstance2" type="MeshInstance" parent="."]
+transform = Transform( 7.12149e-15, 4.37114e-08, -1, 1, -1.62921e-07, 0, -1.62921e-07, -1, -4.37114e-08, 0.488319, 12, -50.4671 )
+mesh = SubResource( 1 )
+material/0 = null
+
+[node name="StaticBody" type="StaticBody" parent="MeshInstance2"]
+
+[node name="CollisionShape" type="CollisionShape" parent="MeshInstance2/StaticBody"]
+shape = SubResource( 4 )
-[node name="car_body" type="MeshInstance" parent="car"]
-mesh = SubResource( 4 )
+[node name="MeshInstance3" type="MeshInstance" parent="."]
+transform = Transform( 7.12149e-15, 4.37114e-08, -1, 1, -1.62921e-07, 0, -1.62921e-07, -1, -4.37114e-08, 0.488319, 12, 49 )
+mesh = SubResource( 1 )
material/0 = null
-[node name="CollisionShape" type="CollisionShape" parent="car"]
+[node name="StaticBody" type="StaticBody" parent="MeshInstance3"]
+
+[node name="CollisionShape" type="CollisionShape" parent="MeshInstance3/StaticBody"]
shape = SubResource( 5 )
-[node name="front_left_wheel" type="VehicleWheel" parent="car"]
-transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1 )
-use_as_steering = true
-wheel_radius = 0.4
-suspension_stiffness = 50.0
-damping_compression = 1.9
-damping_relaxation = 2.0
-
-[node name="MeshInstance" type="MeshInstance" parent="car/front_left_wheel"]
-transform = Transform( -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 0, 0, 1, 0, 0, 0 )
-mesh = SubResource( 6 )
-material/0 = SubResource( 7 )
-
-[node name="front_right_wheel" type="VehicleWheel" parent="car"]
-transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 0, 1 )
-use_as_steering = true
-wheel_radius = 0.4
-suspension_stiffness = 50.0
-damping_compression = 1.9
-damping_relaxation = 2.0
-
-[node name="MeshInstance" type="MeshInstance" parent="car/front_right_wheel"]
-transform = Transform( -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 0, 0, 1, 0, 0, 0 )
-mesh = SubResource( 6 )
-material/0 = SubResource( 7 )
-
-[node name="back_left_wheel" type="VehicleWheel" parent="car"]
-transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, -1 )
-use_as_traction = true
-wheel_radius = 0.4
-suspension_stiffness = 50.0
-damping_compression = 1.9
-damping_relaxation = 2.0
-
-[node name="MeshInstance" type="MeshInstance" parent="car/back_left_wheel"]
-transform = Transform( -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 0, 0, 1, 0, 0, 0 )
-mesh = SubResource( 6 )
-material/0 = SubResource( 7 )
-
-[node name="back_right_wheel" type="VehicleWheel" parent="car"]
-transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 0, -1 )
-use_as_traction = true
-wheel_radius = 0.4
-suspension_stiffness = 50.0
-damping_compression = 1.9
-damping_relaxation = 2.0
-
-[node name="MeshInstance" type="MeshInstance" parent="car/back_right_wheel"]
-transform = Transform( -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 0, 0, 1, 0, 0, 0 )
-mesh = SubResource( 6 )
-material/0 = SubResource( 7 )
-
-[node name="Camera" type="Camera" parent="."]
-transform = Transform( 1, 0, 0, 0, 0.934931, 0.35483, 0, -0.35483, 0.934931, 0, 3, 4 )
+[node name="ground" type="MeshInstance" parent="."]
+mesh = SubResource( 7 )
+material/0 = null
+
+[node name="StaticBody" type="StaticBody" parent="ground"]
+
+[node name="CollisionShape" type="CollisionShape" parent="ground/StaticBody"]
+shape = SubResource( 8 )
+
+[node name="car" parent="." instance=ExtResource( 1 )]
+transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.00634, -4 )
+
+[node name="ball" parent="." instance=ExtResource( 2 )]