implemented level select, options menu, different audio buses & sliders
This commit is contained in:
parent
17085c5148
commit
f51914161e
14 changed files with 485 additions and 46 deletions
|
|
@ -1,48 +0,0 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://cdlbh3smpgg42"]
|
||||
|
||||
[ext_resource type="Script" path="res://src/game/hud_controller.gd" id="1_ckegs"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_pv71o"]
|
||||
font_size = 40
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_cu1nb"]
|
||||
font_size = 34
|
||||
|
||||
[node name="hud" type="Control" node_paths=PackedStringArray("speed", "distance")]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_ckegs")
|
||||
speed = NodePath("Speedometer")
|
||||
distance = NodePath("Distancemeter")
|
||||
|
||||
[node name="Speedometer" type="Label" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 1.0
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -220.0
|
||||
offset_top = -103.0
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 0
|
||||
text = "speed"
|
||||
label_settings = SubResource("LabelSettings_pv71o")
|
||||
horizontal_alignment = 2
|
||||
vertical_alignment = 2
|
||||
|
||||
[node name="Distancemeter" type="Label" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 5
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
offset_left = -20.0
|
||||
offset_right = 20.0
|
||||
offset_bottom = 23.0
|
||||
grow_horizontal = 2
|
||||
text = "distance"
|
||||
label_settings = SubResource("LabelSettings_cu1nb")
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
extends Control
|
||||
#references
|
||||
## reference to the speedometer label
|
||||
@export var speed: Label
|
||||
## reference to the distance meter label
|
||||
@export var distance: Label
|
||||
|
||||
func _on_player_speed_changed(speed_float:float):
|
||||
var speed_string = "%.f" % speed_float
|
||||
# print_debug("changing speed display to ", speed_string)
|
||||
speed.set_text(speed_string)
|
||||
|
||||
func _on_level_distance_changed(distance_float):
|
||||
var distance_string ="%.f" % distance_float
|
||||
distance.set_text(distance_string)
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
[gd_scene load_steps=10 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://dio3rrptd6w7c" path="res://assets/bg2.png" id="2_bk3ik"]
|
||||
[ext_resource type="PackedScene" uid="uid://cdlbh3smpgg42" path="res://src/game/hud.tscn" id="2_w64nx"]
|
||||
[ext_resource type="Texture2D" uid="uid://ds0un04pocx6i" path="res://assets/track90.png" id="3_jtw40"]
|
||||
[ext_resource type="Texture2D" uid="uid://dmcrms0qu0mtt" path="res://assets/finish2.png" id="4_rxurh"]
|
||||
[ext_resource type="Texture2D" uid="uid://bq151lkkfdlf4" path="res://assets/sign.png" id="7_g24mp"]
|
||||
[ext_resource type="AudioStream" uid="uid://dh5jxxwim7ra8" path="res://assets/sounds/music/death_by_waveshaper.wav" id="8_ppkte"]
|
||||
[ext_resource type="Script" path="res://src/game/levels/level.gd" id="1_s3rsn"]
|
||||
[ext_resource type="Texture2D" uid="uid://dio3rrptd6w7c" path="res://assets/bg2.png" id="2_57sr6"]
|
||||
[ext_resource type="Texture2D" uid="uid://ds0un04pocx6i" path="res://assets/track90.png" id="3_en5wc"]
|
||||
[ext_resource type="Texture2D" uid="uid://dmcrms0qu0mtt" path="res://assets/finish2.png" id="4_qeube"]
|
||||
[ext_resource type="PackedScene" uid="uid://ckau5s2tsb3oc" path="res://src/game/player.tscn" id="5_2n8nj"]
|
||||
[ext_resource type="PackedScene" uid="uid://cdlbh3smpgg42" path="res://src/gui/hud/hud.tscn" id="6_r1i0q"]
|
||||
[ext_resource type="Texture2D" uid="uid://bq151lkkfdlf4" path="res://assets/sign.png" id="7_xmahe"]
|
||||
[ext_resource type="AudioStream" uid="uid://dh5jxxwim7ra8" path="res://assets/sounds/music/death_by_waveshaper.wav" id="8_qlkhp"]
|
||||
|
||||
[sub_resource type="Curve2D" id="Curve2D_ll8bj"]
|
||||
_data = {
|
||||
|
|
@ -16,7 +16,7 @@ _data = {
|
|||
point_count = 7
|
||||
|
||||
[node name="level1" type="Node2D" node_paths=PackedStringArray("path", "line", "player", "finish")]
|
||||
script = ExtResource("1_hv75i")
|
||||
script = ExtResource("1_s3rsn")
|
||||
starting_width = 400.0
|
||||
shrink_factor = 5.0
|
||||
path = NodePath("TrackPath")
|
||||
|
|
@ -31,7 +31,7 @@ offset_top = -3355.0
|
|||
offset_right = 19845.0
|
||||
offset_bottom = 12825.0
|
||||
scale = Vector2(0.5, 0.5)
|
||||
texture = ExtResource("2_bk3ik")
|
||||
texture = ExtResource("2_57sr6")
|
||||
stretch_mode = 1
|
||||
|
||||
[node name="TrackPath" type="Path2D" parent="."]
|
||||
|
|
@ -40,47 +40,82 @@ curve = SubResource("Curve2D_ll8bj")
|
|||
[node name="TrackLine" type="Line2D" parent="."]
|
||||
self_modulate = Color(0.164706, 0.658824, 0.858824, 1)
|
||||
texture_repeat = 2
|
||||
texture = ExtResource("3_jtw40")
|
||||
texture = ExtResource("3_en5wc")
|
||||
texture_mode = 2
|
||||
begin_cap_mode = 2
|
||||
|
||||
[node name="FinishLine" type="Line2D" parent="."]
|
||||
texture_repeat = 2
|
||||
width = 40.0
|
||||
texture = ExtResource("4_rxurh")
|
||||
texture = ExtResource("4_qeube")
|
||||
texture_mode = 1
|
||||
begin_cap_mode = 2
|
||||
end_cap_mode = 2
|
||||
round_precision = 32
|
||||
antialiased = true
|
||||
|
||||
[node name="player" parent="." instance=ExtResource("2_5nf51")]
|
||||
[node name="player" parent="." instance=ExtResource("5_2n8nj")]
|
||||
position = Vector2(27, -55)
|
||||
brake_strength = 800.0
|
||||
|
||||
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="hud" parent="CanvasLayer" instance=ExtResource("2_w64nx")]
|
||||
[node name="hud" parent="CanvasLayer" instance=ExtResource("6_r1i0q")]
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="curveSign" type="PointLight2D" parent="."]
|
||||
position = Vector2(-1914, -560)
|
||||
scale = Vector2(0.1, 0.1)
|
||||
color = Color(1, 0.0627451, 0.694118, 1)
|
||||
energy = 20.0
|
||||
texture = ExtResource("7_g24mp")
|
||||
[node name="Node2D" type="Node2D" parent="."]
|
||||
|
||||
[node name="curveSign2" type="PointLight2D" parent="."]
|
||||
position = Vector2(-1997, -491)
|
||||
scale = Vector2(0.1, 0.1)
|
||||
color = Color(1, 0.0627451, 0.694118, 1)
|
||||
[node name="curveSign3" type="PointLight2D" parent="Node2D"]
|
||||
position = Vector2(-1720, 2263)
|
||||
rotation = -1.182
|
||||
scale = Vector2(0.3, 0.3)
|
||||
color = Color(0.690196, 0.545098, 0.0509804, 1)
|
||||
energy = 20.0
|
||||
texture = ExtResource("7_g24mp")
|
||||
texture = ExtResource("7_xmahe")
|
||||
|
||||
[node name="curveSign" type="PointLight2D" parent="Node2D"]
|
||||
position = Vector2(-2040, 2122)
|
||||
rotation = -1.27745
|
||||
scale = Vector2(0.3, 0.3)
|
||||
color = Color(0.690196, 0.545098, 0.0509804, 1)
|
||||
energy = 20.0
|
||||
texture = ExtResource("7_xmahe")
|
||||
|
||||
[node name="curveSign2" type="PointLight2D" parent="Node2D"]
|
||||
position = Vector2(-2337, -124)
|
||||
scale = Vector2(0.3, 0.3)
|
||||
color = Color(0.933333, 0, 0.0235294, 1)
|
||||
energy = 20.0
|
||||
texture = ExtResource("7_xmahe")
|
||||
|
||||
[node name="curveSign4" type="PointLight2D" parent="Node2D"]
|
||||
position = Vector2(-2447, 113)
|
||||
scale = Vector2(0.3, 0.3)
|
||||
color = Color(0.933333, 0, 0.0235294, 1)
|
||||
energy = 20.0
|
||||
texture = ExtResource("7_xmahe")
|
||||
|
||||
[node name="curveSign5" type="PointLight2D" parent="Node2D"]
|
||||
position = Vector2(2664, -97.0001)
|
||||
rotation = 1.74374
|
||||
scale = Vector2(0.3, 0.3)
|
||||
color = Color(0.690196, 0.545098, 0.0509804, 1)
|
||||
energy = 20.0
|
||||
texture = ExtResource("7_xmahe")
|
||||
|
||||
[node name="curveSign6" type="PointLight2D" parent="Node2D"]
|
||||
position = Vector2(2899, 56)
|
||||
rotation = 2.04177
|
||||
scale = Vector2(0.3, 0.3)
|
||||
color = Color(0.690196, 0.545098, 0.0509804, 1)
|
||||
energy = 20.0
|
||||
texture = ExtResource("7_xmahe")
|
||||
|
||||
[node name="level_music" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("8_ppkte")
|
||||
stream = ExtResource("8_qlkhp")
|
||||
volume_db = -29.953
|
||||
autoplay = true
|
||||
bus = &"Music"
|
||||
|
||||
[connection signal="distance_changed" from="." to="CanvasLayer/hud" method="_on_level_distance_changed"]
|
||||
[connection signal="speed_changed" from="player" to="CanvasLayer/hud" method="_on_player_speed_changed"]
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=8 format=3 uid="uid://ckau5s2tsb3oc"]
|
||||
[gd_scene load_steps=9 format=3 uid="uid://ckau5s2tsb3oc"]
|
||||
|
||||
[ext_resource type="Script" path="res://src/game/player_controller.gd" id="1_g4ij8"]
|
||||
[ext_resource type="Texture2D" uid="uid://bx4nammvn7hea" path="res://assets/vehicle2.png" id="2_ifw0w"]
|
||||
|
|
@ -55,13 +55,16 @@ rotation_smoothing_speed = 10.0
|
|||
|
||||
[node name="engine_sounds" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("4_4ajo8")
|
||||
volume_db = -40.467
|
||||
volume_db = -30.204
|
||||
autoplay = true
|
||||
bus = &"Sfx"
|
||||
|
||||
[node name="damage_sounds" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("5_rvolc")
|
||||
volume_db = -25.297
|
||||
bus = &"Sfx"
|
||||
|
||||
[node name="death_sound" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("6_i0vg5")
|
||||
volume_db = -25.297
|
||||
bus = &"Sfx"
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ func _process(delta):
|
|||
|
||||
if !dead:
|
||||
var acc_d = acc * delta
|
||||
var rev_d = rev * delta
|
||||
# var rev_d = rev * delta
|
||||
var turn_d = turn_speed * delta
|
||||
var brake_d = brake_strength * delta
|
||||
var turn_factor = 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue