2024-11-04 18:55:13 +00:00
|
|
|
[gd_scene load_steps=6 format=3 uid="uid://0g7qqh7naniv"]
|
2024-11-03 18:16:30 +00:00
|
|
|
|
|
|
|
[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"]
|
2024-11-04 18:55:13 +00:00
|
|
|
[ext_resource type="Texture2D" uid="uid://mqdujngircok" path="res://sprites/car_features.png" id="3_ts6mm"]
|
|
|
|
[ext_resource type="Texture2D" uid="uid://e5aeyl47wi8p" path="res://sprites/car_body.png" id="4_lps13"]
|
2024-11-03 18:16:30 +00:00
|
|
|
|
|
|
|
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_bj1hp"]
|
|
|
|
radius = 8.0
|
|
|
|
height = 34.0
|
|
|
|
|
|
|
|
[node name="Car" type="Node2D"]
|
|
|
|
script = ExtResource("1_0tin3")
|
|
|
|
|
2024-11-04 20:56:07 +00:00
|
|
|
[node name="CharacterBody_Car" type="CharacterBody2D" parent="."]
|
|
|
|
motion_mode = 1
|
2024-11-03 18:16:30 +00:00
|
|
|
script = ExtResource("1_i5tet")
|
|
|
|
|
2024-11-04 20:56:07 +00:00
|
|
|
[node name="sprite_features" type="Sprite2D" parent="CharacterBody_Car"]
|
2024-11-03 18:16:30 +00:00
|
|
|
z_index = 10
|
|
|
|
scale = Vector2(0.5, 0.5)
|
2024-11-04 18:55:13 +00:00
|
|
|
texture = ExtResource("3_ts6mm")
|
|
|
|
|
2024-11-04 20:56:07 +00:00
|
|
|
[node name="sprite_body" type="Sprite2D" parent="CharacterBody_Car"]
|
2024-11-04 18:55:13 +00:00
|
|
|
z_index = 10
|
|
|
|
scale = Vector2(0.5, 0.5)
|
|
|
|
texture = ExtResource("4_lps13")
|
2024-11-03 18:16:30 +00:00
|
|
|
|
2024-11-04 20:56:07 +00:00
|
|
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="CharacterBody_Car"]
|
2024-11-03 18:16:30 +00:00
|
|
|
rotation = -1.57079
|
|
|
|
shape = SubResource("CapsuleShape2D_bj1hp")
|
|
|
|
|
2024-11-04 20:56:07 +00:00
|
|
|
[node name="RayCast_FL" type="RayCast2D" parent="CharacterBody_Car"]
|
2024-11-03 18:16:30 +00:00
|
|
|
target_position = Vector2(256, -128)
|
|
|
|
collision_mask = 2
|
|
|
|
|
2024-11-04 20:56:07 +00:00
|
|
|
[node name="RayCast_FR" type="RayCast2D" parent="CharacterBody_Car"]
|
2024-11-03 18:16:30 +00:00
|
|
|
target_position = Vector2(256, 128)
|
|
|
|
collision_mask = 2
|
|
|
|
|
2024-11-04 20:56:07 +00:00
|
|
|
[node name="resetTimer" type="Timer" parent="CharacterBody_Car"]
|
2024-11-03 18:16:30 +00:00
|
|
|
one_shot = true
|
|
|
|
|
2024-11-04 20:56:07 +00:00
|
|
|
[node name="RayCast_Car" type="RayCast2D" parent="CharacterBody_Car"]
|
2024-11-03 18:16:30 +00:00
|
|
|
position = Vector2(-15, 0)
|
|
|
|
target_position = Vector2(31, 0)
|
2024-11-05 07:18:14 +00:00
|
|
|
collision_mask = 12
|
|
|
|
collide_with_areas = true
|
2024-11-03 18:16:30 +00:00
|
|
|
|
2024-11-04 20:56:07 +00:00
|
|
|
[node name="collisionEnableTimer" type="Timer" parent="CharacterBody_Car"]
|
|
|
|
wait_time = 0.1
|
|
|
|
one_shot = true
|
|
|
|
|
|
|
|
[connection signal="timeout" from="CharacterBody_Car/resetTimer" to="CharacterBody_Car" method="_on_reset_timer_timeout"]
|
|
|
|
[connection signal="timeout" from="CharacterBody_Car/collisionEnableTimer" to="CharacterBody_Car" method="_on_collision_enable_timer_timeout"]
|