teststrecke-game/scenes/tire_trail.tscn
2024-11-11 17:34:23 +01:00

38 lines
996 B
Text

[gd_scene load_steps=3 format=3 uid="uid://c3fdxjrpcgnnp"]
[sub_resource type="Curve" id="Curve_ckg0w"]
_data = [Vector2(0, 0), 0.0, 3.77363, 0, 0, Vector2(1, 0), -4.04783, 0.0, 0, 0]
point_count = 2
[sub_resource type="GDScript" id="GDScript_6pryv"]
script/source = "extends Line2D
var point
var isSliding=false
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
set_as_top_level(true)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _physics_process(delta):
pass
func _process(delta: float) -> void:
if isSliding:
point = get_parent().global_position
add_point(point)
if points.size()>100:
remove_point(0)
func setSliding(psliding:bool):
#if not isSliding and psliding: #just started sliding
#clear_points()
isSliding=psliding
"
[node name="Trail" type="Line2D"]
z_index = 9
width = 4.0
width_curve = SubResource("Curve_ckg0w")
default_color = Color(0, 0, 0, 1)
script = SubResource("GDScript_6pryv")