added track texture, changed track, changed vehicle movement and camera

This commit is contained in:
Metzkermeister 2023-09-30 20:15:39 +02:00
parent 753cb4eb2a
commit 5924215f3c
4 changed files with 48 additions and 7 deletions

View file

@ -1,16 +1,18 @@
[gd_scene load_steps=4 format=3 uid="uid://c77xk0mywwt5f"]
[gd_scene load_steps=5 format=3 uid="uid://c77xk0mywwt5f"]
[ext_resource type="Script" path="res://src/game/level.gd" id="1_hv75i"]
[ext_resource type="PackedScene" uid="uid://ckau5s2tsb3oc" path="res://src/game/player.tscn" id="2_5nf51"]
[ext_resource type="Texture2D" uid="uid://bd0jqkgq1gh7p" path="res://assets/track.png" id="2_knecs"]
[sub_resource type="Curve2D" id="Curve2D_ll8bj"]
_data = {
"points": PackedVector2Array(-33.6888, -46.2486, 33.6888, 46.2486, 325, 200, -79.196, 14.1421, 79.196, -14.1421, 543, 271, -62.2254, 38.1838, 62.2254, -38.1838, 714, 113, -35.3553, -48.0833, 35.3553, 48.0833, 961, 148, 62.2254, -69.2965, -62.2254, 69.2965, 978, 429, 59.397, -33.9411, -59.397, 33.9411, 739, 445, 77.7818, -1.41421, -77.7818, 1.41421, 596, 562, 62.2254, 25.4558, -62.2254, -25.4558, 316, 518, 42.4264, 69.2965, -42.4264, -69.2965, 119, 387, -1.41421, 50.9117, 1.41421, -50.9117, 72, 187, -33.9411, 22.6274, 33.9411, -22.6274, 137, 52, -38.1838, -12.7279, 38.1838, 12.7279, 241, 47, -25.4558, -49.4975, 25.4558, 49.4975, 299, 154, -15.3576, -23.2238, 15.3576, 23.2238, 325, 200)
"points": PackedVector2Array(-96.196, 0.475433, 96.196, -0.475433, 59, -56, -752, -468, 752, 468, 2353, -2, 962.225, -826.544, -962.225, 826.544, 2317, 1760, 370.586, 534.912, -370.586, -534.912, -2118, 1739, -352, 856, 352, -856, -2086, 159, -428, -220, 428, 220, -810, -253, -102.358, -2.55713, 102.358, 2.55713, 59, -56)
}
point_count = 14
point_count = 7
[node name="level1" type="Node2D" node_paths=PackedStringArray("path", "line")]
script = ExtResource("1_hv75i")
starting_width = 400.0
shrink_factor = 0.5
path = NodePath("TrackPath")
line = NodePath("TrackLine")
@ -19,6 +21,9 @@ line = NodePath("TrackLine")
curve = SubResource("Curve2D_ll8bj")
[node name="TrackLine" type="Line2D" parent="."]
texture_repeat = 2
texture = ExtResource("2_knecs")
texture_mode = 2
[node name="player" parent="." instance=ExtResource("2_5nf51")]
position = Vector2(42.7545, -14.9219)

View file

@ -8,11 +8,13 @@ size = Vector2(36, 20)
[node name="player" type="StaticBody2D" node_paths=PackedStringArray("camera")]
script = ExtResource("1_g4ij8")
acc = 500.0
acc = 600.0
dec = 400.0
max_speed = 1000.0
turn_speed = 2.0
brake_strength = 60.0
max_speed = 3000.0
turn_speed = 0.8
brake_strength = 600.0
drift_factor = 1.2
camera_offset_factor = 0.5
camera = NodePath("Camera2D")
[node name="Sprite2D" type="Sprite2D" parent="."]