diff --git a/scenes/car.tscn b/scenes/car.tscn index 0695827..1b84436 100644 --- a/scenes/car.tscn +++ b/scenes/car.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=50 format=3 uid="uid://0g7qqh7naniv"] +[gd_scene load_steps=51 format=3 uid="uid://0g7qqh7naniv"] [ext_resource type="Script" path="res://scripts/car_node.gd" id="1_0tin3"] [ext_resource type="Script" path="res://scripts/car.gd" id="1_i5tet"] [ext_resource type="Texture2D" uid="uid://c5rlo1fhm3bl4" path="res://sprites/bobbycar_features.png" id="3_k2wmt"] [ext_resource type="Texture2D" uid="uid://dojj5iqges76q" path="res://sprites/bobbycar_body.png" id="4_2gwtk"] [ext_resource type="Script" path="res://scripts/tiretrails.gd" id="5_4geqi"] +[ext_resource type="Texture2D" uid="uid://dkg8e3stos5rw" path="res://sprites/bobbycar_steeringwheel.png" id="5_swfp0"] [ext_resource type="Script" path="res://scripts/label_round.gd" id="5_vheit"] [ext_resource type="PackedScene" uid="uid://dilif5od0ipli" path="res://scenes/burnout.tscn" id="6_nxxrr"] [ext_resource type="PackedScene" uid="uid://dl7r8s5sxyvlw" path="res://scenes/enginesound.tscn" id="6_v21se"] @@ -140,17 +141,25 @@ script = ExtResource("1_0tin3") motion_mode = 1 script = ExtResource("1_i5tet") +[node name="sprite_body" type="Sprite2D" parent="CharacterBody_Car"] +z_index = 10 +texture_filter = 1 +scale = Vector2(0.5, 0.5) +texture = ExtResource("4_2gwtk") + [node name="sprite_features" type="Sprite2D" parent="CharacterBody_Car"] z_index = 10 texture_filter = 1 scale = Vector2(0.5, 0.5) texture = ExtResource("3_k2wmt") -[node name="sprite_body" type="Sprite2D" parent="CharacterBody_Car"] +[node name="sprite_steeringwheel" type="Sprite2D" parent="CharacterBody_Car"] z_index = 10 texture_filter = 1 +position = Vector2(3, 0) scale = Vector2(0.5, 0.5) -texture = ExtResource("4_2gwtk") +texture = ExtResource("5_swfp0") +offset = Vector2(-6, 0) [node name="CollisionShape2D" type="CollisionShape2D" parent="CharacterBody_Car"] rotation = -1.57079 diff --git a/scripts/car.gd b/scripts/car.gd index d72d031..1f61f46 100644 --- a/scripts/car.gd +++ b/scripts/car.gd @@ -36,6 +36,9 @@ var slip_speed = 150 var traction_fast = 0.05 #traction when above slip_speed var traction_slow = 0.5 +var max_steering_change = 2.5 +var turndirection_scale = 0.01 + #Automatic Steering settings @@ -203,16 +206,17 @@ func get_input(delta:float): var distance_min= min(distance_fl,distance_fr) - var turndirection = 1 if distance_fl