before planets
This commit is contained in:
parent
bb6404e918
commit
e09f05b566
57 changed files with 1203 additions and 90 deletions
BIN
entities/car/33480__hiccupvirus__stereo-tron-bike-engine.wav
Normal file
BIN
entities/car/33480__hiccupvirus__stereo-tron-bike-engine.wav
Normal file
Binary file not shown.
|
@ -0,0 +1,24 @@
|
|||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://dycfldtocfi6a"
|
||||
path="res://.godot/imported/33480__hiccupvirus__stereo-tron-bike-engine.wav-ca695db0062fc4a0abf1e4cca8d6dbaa.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://entities/car/33480__hiccupvirus__stereo-tron-bike-engine.wav"
|
||||
dest_files=["res://.godot/imported/33480__hiccupvirus__stereo-tron-bike-engine.wav-ca695db0062fc4a0abf1e4cca8d6dbaa.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=3
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=2
|
|
@ -28,7 +28,7 @@ var current_steer_speed = base_steer_speed
|
|||
var last_steer_input := 0.0
|
||||
var rotation_angle := 0.0
|
||||
|
||||
var respawn_pos : Vector3
|
||||
var respawn_trans : Transform3D
|
||||
|
||||
var thread: Thread = Thread.new()
|
||||
var steer_input = 0.0
|
||||
|
@ -40,17 +40,14 @@ func custom_gravity() -> Vector3:
|
|||
var closest_offset = road_path.curve.get_closest_offset(road_path.to_local(position))
|
||||
var closest_transform = road_path.curve.sample_baked_with_rotation(closest_offset, true, true)
|
||||
var closest_point = road_path.to_global(closest_transform.origin)
|
||||
#var project_plane = Plane(closest_transform.basis.y.normalized(), closest_point)
|
||||
#print(closest_point)
|
||||
#return -project_plane.project(position).normalized() * 0.1
|
||||
#var attractor = road_path.to_global(road_path.curve.get_closest_point(road_path.to_local(position)))
|
||||
|
||||
return -closest_transform.basis.y
|
||||
|
||||
func return_to_road():
|
||||
position = respawn_pos + 3*Vector3.UP
|
||||
rotation.z = 0
|
||||
rotation.x = 0
|
||||
var closest_offset = road_path.curve.get_closest_offset(road_path.to_local(position))
|
||||
var closest_transform = road_path.curve.sample_baked_with_rotation(closest_offset, true, true)
|
||||
transform = respawn_trans
|
||||
position += closest_transform.basis.y * 2.0
|
||||
|
||||
linear_velocity = Vector3.ZERO
|
||||
angular_velocity = Vector3.ZERO
|
||||
|
@ -61,6 +58,9 @@ func _process(_delta: float) -> void:
|
|||
|
||||
if Input.is_action_just_pressed("restart"):
|
||||
return_to_road()
|
||||
|
||||
if Input.is_action_just_pressed("hardRestart"):
|
||||
get_tree().reload_current_scene()
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
var move_input := Input.get_axis("back", "forward")
|
||||
|
@ -68,17 +68,16 @@ func _physics_process(delta: float) -> void:
|
|||
steer_input = lerpf(steer_input, steer_input_brut, 0.1)
|
||||
var is_on_floor := backward_left_respawn.is_colliding() || backward_right_respawn.is_colliding() || forward_left_respawn.is_colliding() || forward_right_respawn.is_colliding()
|
||||
var is_all_wheel_on_floor := backward_left_respawn.is_colliding() && backward_right_respawn.is_colliding() && forward_left_respawn.is_colliding() && forward_right_respawn.is_colliding()
|
||||
var is_flat : bool = transform.basis.y.dot(Vector3.UP) > 0.9
|
||||
|
||||
# Doing custom gravity like a chad
|
||||
PhysicsServer3D.area_set_param(get_viewport().find_world_3d().space, PhysicsServer3D.AREA_PARAM_GRAVITY_VECTOR, custom_gravity())
|
||||
|
||||
if is_all_wheel_on_floor && is_flat:
|
||||
respawn_pos = position
|
||||
if is_all_wheel_on_floor:
|
||||
respawn_trans = transform
|
||||
|
||||
if !is_on_floor:
|
||||
air_time += delta
|
||||
if air_time > 1.5:
|
||||
if air_time > 3:
|
||||
return_to_road()
|
||||
return
|
||||
air_time = 0.0
|
||||
|
@ -92,30 +91,18 @@ func _physics_process(delta: float) -> void:
|
|||
|
||||
# Rotation
|
||||
rotation_angle = steer_input * delta
|
||||
#angular_velocity = steer_input * delta * global_transform.basis.y * 30.0
|
||||
rotate(global_transform.basis.y, rotation_angle)
|
||||
|
||||
# Drift Simulation
|
||||
var velocity = linear_velocity
|
||||
var forward_dir = global_transform.basis.z
|
||||
if forward_dir.length_squared() == 0.0:
|
||||
return # skip drift this frame if something is invalid
|
||||
return
|
||||
forward_dir = forward_dir.normalized()
|
||||
|
||||
var forward_velocity = forward_dir * velocity.dot(forward_dir)
|
||||
var lateral_velocity = velocity - forward_velocity
|
||||
|
||||
var drift_factor = inverse_lerp(
|
||||
lateral_velocity_total_drift_threshold,
|
||||
lateral_velocity_start_drift_threshold,
|
||||
lateral_velocity.length()
|
||||
)
|
||||
drift_factor = clamp(drift_factor, 0, 1)
|
||||
|
||||
|
||||
steer_speed = lerp(steer_speed * 2.0, base_steer_speed, drift_factor)
|
||||
|
||||
var lateral_friction_force = -lateral_velocity * base_lateral_friction * drift_factor
|
||||
var lateral_friction_force = -lateral_velocity * base_lateral_friction
|
||||
apply_central_force(lateral_friction_force)
|
||||
|
||||
|
||||
|
|
|
@ -1,20 +1,24 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://dgs0fqojgcmu3"]
|
||||
[gd_scene load_steps=7 format=3 uid="uid://dgs0fqojgcmu3"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ctjy0e806j0vk" path="res://entities/car/car.gd" id="1_nh45c"]
|
||||
[ext_resource type="PackedScene" uid="uid://drrl25ujbosbr" path="res://entities/car/tron_moto_lowpoly/scene.gltf" id="2_1ang0"]
|
||||
[ext_resource type="AudioStream" uid="uid://dycfldtocfi6a" path="res://entities/car/33480__hiccupvirus__stereo-tron-bike-engine.wav" id="3_x0apo"]
|
||||
[ext_resource type="PackedScene" uid="uid://npanejthded5" path="res://entities/car/tron_moto_lowpoly/sketchfab_scene.tscn" id="4_hk7sx"]
|
||||
[ext_resource type="Script" uid="uid://bggsg5iqltuk3" path="res://entities/car/motor_stream.gd" id="4_qxogl"]
|
||||
|
||||
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_1ang0"]
|
||||
friction = 0.5
|
||||
rough = true
|
||||
absorbent = true
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_76tdi"]
|
||||
size = Vector3(1, 0, 2.2)
|
||||
|
||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_yotxw"]
|
||||
height = 1.1
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_qxogl"]
|
||||
size = Vector3(2.99533, 1, 1)
|
||||
|
||||
[node name="Car" type="RigidBody3D"]
|
||||
mass = 10.0
|
||||
physics_material_override = SubResource("PhysicsMaterial_1ang0")
|
||||
continuous_cd = true
|
||||
contact_monitor = true
|
||||
max_contacts_reported = 4
|
||||
script = ExtResource("1_nh45c")
|
||||
|
||||
[node name="ForwardLeft" type="RayCast3D" parent="."]
|
||||
|
@ -29,18 +33,9 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5, 0.435121, 1)
|
|||
[node name="BackwardLeft" type="RayCast3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.5, 0.435121, 1)
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.1)
|
||||
shape = SubResource("BoxShape3D_76tdi")
|
||||
disabled = true
|
||||
|
||||
[node name="CollisionShape3D2" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(-4.37114e-08, 1, -4.37114e-08, 0, -4.37114e-08, -1, -1, -4.37114e-08, 1.91069e-15, 0, 0, 1)
|
||||
shape = SubResource("CylinderShape3D_yotxw")
|
||||
|
||||
[node name="CollisionShape3D3" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(-4.37114e-08, 1, -4.37114e-08, 0, -4.37114e-08, -1, -1, -4.37114e-08, 1.91069e-15, 0, 0, -1.2)
|
||||
shape = SubResource("CylinderShape3D_yotxw")
|
||||
transform = Transform3D(-4.37114e-08, 1, -4.37114e-08, 0, -4.37114e-08, -1, -1, -4.37114e-08, 1.91069e-15, -4.73325e-08, 0, -0.08284)
|
||||
shape = SubResource("BoxShape3D_qxogl")
|
||||
|
||||
[node name="RaycastsRespawn" type="Node3D" parent="."]
|
||||
transform = Transform3D(2, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0)
|
||||
|
@ -57,12 +52,20 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5, 0, 1)
|
|||
[node name="BackwardLeftRespawn" type="RayCast3D" parent="RaycastsRespawn"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.5, 0, 1)
|
||||
|
||||
[node name="Sketchfab_Scene" parent="." instance=ExtResource("2_1ang0")]
|
||||
transform = Transform3D(-0.35, 0, -3.0598e-08, 0, 0.35, 0, 3.0598e-08, 0, -0.35, 0.0317484, -0.52664, 0)
|
||||
|
||||
[node name="CameraFollowPoint" type="Marker3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.31962, -2.93594)
|
||||
|
||||
[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="."]
|
||||
[node name="MotorStream" type="AudioStreamPlayer3D" parent="."]
|
||||
stream = ExtResource("3_x0apo")
|
||||
autoplay = true
|
||||
bus = &"Motor"
|
||||
script = ExtResource("4_qxogl")
|
||||
|
||||
[node name="Sketchfab_Scene2" parent="." instance=ExtResource("4_hk7sx")]
|
||||
transform = Transform3D(-0.35, 0, -5.28485e-08, 0, 0.35, 0, 5.28485e-08, 0, -0.35, 0.0317484, -0.52664, 0)
|
||||
|
||||
[node name="OmniLight3D" type="OmniLight3D" parent="."]
|
||||
light_color = Color(0.0217323, 0.905795, 0.982301, 1)
|
||||
omni_range = 3.75794
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||
|
|
6
entities/car/motor_stream.gd
Normal file
6
entities/car/motor_stream.gd
Normal file
|
@ -0,0 +1,6 @@
|
|||
extends AudioStreamPlayer3D
|
||||
|
||||
@onready var car: Car = $".."
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
pitch_scale = max(car.linear_velocity.length() * 0.1, 0.1)
|
1
entities/car/motor_stream.gd.uid
Normal file
1
entities/car/motor_stream.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://bggsg5iqltuk3
|
|
@ -32,6 +32,17 @@ animation/trimming=false
|
|||
animation/remove_immutable_tracks=true
|
||||
animation/import_rest_as_RESET=false
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
_subresources={
|
||||
"meshes": {
|
||||
"Sketchfab_Scene_Object_2": {
|
||||
"generate/lightmap_uv": 0,
|
||||
"generate/lods": 0,
|
||||
"generate/shadow_meshes": 0,
|
||||
"lods/normal_merge_angle": 60.0,
|
||||
"save_to_file/enabled": true,
|
||||
"save_to_file/path": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
gltf/naming_version=1
|
||||
gltf/embedded_image_handling=1
|
||||
|
|
51
entities/car/tron_moto_lowpoly/sketchfab_scene.tscn
Normal file
51
entities/car/tron_moto_lowpoly/sketchfab_scene.tscn
Normal file
File diff suppressed because one or more lines are too long
|
@ -1,13 +1,11 @@
|
|||
extends Node
|
||||
|
||||
|
||||
const LEVELS = [preload("res://scenes/levels/level1.tscn")]
|
||||
|
||||
var current_level = 0
|
||||
|
||||
@export var nb_checkpoints := 3
|
||||
@export var max_lap := 3
|
||||
|
||||
signal new_lap(value)
|
||||
signal end_track
|
||||
|
||||
var current_checkpoint := 0
|
||||
var current_lap := 0
|
||||
|
||||
|
@ -18,15 +16,16 @@ func checkPointEnter(check_point_id):
|
|||
if check_point_id == 0:
|
||||
current_lap += 1
|
||||
current_checkpoint += 1
|
||||
new_lap.emit(current_lap)
|
||||
else:
|
||||
current_checkpoint += 1
|
||||
current_checkpoint %= nb_checkpoints
|
||||
|
||||
if (current_lap == max_lap):
|
||||
if (current_lap == max_lap+1):
|
||||
endTrack()
|
||||
return
|
||||
|
||||
func endTrack():
|
||||
print("end")
|
||||
current_lap = 0
|
||||
current_checkpoint = 0
|
||||
end_track.emit()
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
extends Area3D
|
||||
class_name CheckPoint
|
||||
@export var check_point_id : int = 0
|
||||
@onready var check_point_manager: Node = $"../../CheckPointManager"
|
||||
|
||||
|
||||
|
||||
|
@ -8,7 +9,7 @@ func _on_body_entered(body: Node3D) -> void:
|
|||
if body is not Car:
|
||||
return
|
||||
|
||||
CheckPointManager.checkPointEnter(check_point_id)
|
||||
check_point_manager.checkPointEnter(check_point_id)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -2,4 +2,6 @@
|
|||
|
||||
[resource]
|
||||
transparency = 1
|
||||
blend_mode = 1
|
||||
albedo_color = Color(0.396078, 1, 0.686275, 0.270588)
|
||||
emission = Color(0.396078, 1, 0.686275, 0.270588)
|
||||
|
|
8
entities/checkpoint/checkpoint_start_mat.tres
Normal file
8
entities/checkpoint/checkpoint_start_mat.tres
Normal file
|
@ -0,0 +1,8 @@
|
|||
[gd_resource type="StandardMaterial3D" format=3 uid="uid://cx7p36k3dewle"]
|
||||
|
||||
[resource]
|
||||
transparency = 1
|
||||
blend_mode = 1
|
||||
albedo_color = Color(0.768627, 0.27451, 0.309804, 0.521569)
|
||||
metallic_specular = 1.0
|
||||
emission = Color(0.768627, 0.27451, 0.309804, 0.521569)
|
47
entities/gameUI/gameUI.tscn
Normal file
47
entities/gameUI/gameUI.tscn
Normal file
|
@ -0,0 +1,47 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://bbl6ouj0ew23c"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cxju8eq6w5rbt" path="res://entities/gameUI/game_ui.gd" id="1_fyng4"]
|
||||
[ext_resource type="LabelSettings" uid="uid://dyfwkfdm7affw" path="res://fonts/ui_label_set.tres" id="2_4gmqh"]
|
||||
[ext_resource type="LabelSettings" uid="uid://c33hoau8vc0q7" path="res://fonts/little_label_settings.tres" id="3_oo04r"]
|
||||
|
||||
[node name="GameUi" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_fyng4")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = -192.0
|
||||
offset_top = 30.0
|
||||
offset_right = -46.0
|
||||
offset_bottom = 112.0
|
||||
grow_horizontal = 0
|
||||
|
||||
[node name="LapLabel" type="Label" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Lap 1/3"
|
||||
label_settings = ExtResource("2_4gmqh")
|
||||
|
||||
[node name="TimeLabel" type="Label" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "57 s"
|
||||
label_settings = ExtResource("2_4gmqh")
|
||||
|
||||
[node name="VBoxContainer2" type="VBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
offset_right = 147.0
|
||||
offset_bottom = 66.0
|
||||
|
||||
[node name="LapLabel" type="Label" parent="VBoxContainer2"]
|
||||
layout_mode = 2
|
||||
text = "Press
|
||||
C to respawn
|
||||
R to restart"
|
||||
label_settings = ExtResource("3_oo04r")
|
20
entities/gameUI/game_ui.gd
Normal file
20
entities/gameUI/game_ui.gd
Normal file
|
@ -0,0 +1,20 @@
|
|||
extends Control
|
||||
class_name GameUI
|
||||
|
||||
var time : float
|
||||
var lap : int
|
||||
|
||||
@onready var lap_label: Label = $VBoxContainer/LapLabel
|
||||
@onready var time_label: Label = $VBoxContainer/TimeLabel
|
||||
|
||||
func _ready():
|
||||
time = 0
|
||||
lap = 0.0
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
time += delta
|
||||
lap_label.text = "Lap " + str(lap) + "/3"
|
||||
time_label.text = str(round(time*100)/100)
|
||||
|
||||
func _on_check_point_manager_new_lap(value: Variant) -> void:
|
||||
lap = value
|
1
entities/gameUI/game_ui.gd.uid
Normal file
1
entities/gameUI/game_ui.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://cxju8eq6w5rbt
|
|
@ -1,11 +1,13 @@
|
|||
extends Control
|
||||
|
||||
func _ready():
|
||||
MusicManager.launch_menu_music()
|
||||
|
||||
func _on_button_1_pressed() -> void:
|
||||
get_tree().change_scene_to_packed(CheckPointManager.LEVELS[0])
|
||||
GameManager.launch_level(0)
|
||||
|
||||
func _on_button_2_pressed() -> void:
|
||||
get_tree().change_scene_to_packed(CheckPointManager.LEVELS[0])
|
||||
GameManager.launch_level(1)
|
||||
|
||||
func _on_button_3_pressed() -> void:
|
||||
get_tree().change_scene_to_packed(CheckPointManager.LEVELS[0])
|
||||
GameManager.launch_level(2)
|
||||
|
|
93
entities/pauseMenu/pauseMenu.tscn
Normal file
93
entities/pauseMenu/pauseMenu.tscn
Normal file
|
@ -0,0 +1,93 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://dlmjehxav11dx"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://catyjdq20adaf" path="res://entities/pauseMenu/pause_menu.gd" id="1_0ddhp"]
|
||||
[ext_resource type="LabelSettings" uid="uid://cru5yoau1mluh" path="res://fonts/BigTextLabelSettings.tres" id="1_6mo0v"]
|
||||
[ext_resource type="Theme" uid="uid://desmbsje23ubj" path="res://fonts/DefautTheme.tres" id="1_bdrf8"]
|
||||
[ext_resource type="LabelSettings" uid="uid://c33hoau8vc0q7" path="res://fonts/little_label_settings.tres" id="4_k4ey7"]
|
||||
|
||||
[node name="PauseMenu" type="Control"]
|
||||
process_mode = 3
|
||||
visible = false
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_0ddhp")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -20.0
|
||||
offset_top = -20.0
|
||||
offset_right = 20.0
|
||||
offset_bottom = 20.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="Label" type="Label" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("1_bdrf8")
|
||||
text = "Main sound"
|
||||
|
||||
[node name="SliderMainSound" type="HSlider" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
value = 50.0
|
||||
|
||||
[node name="Label2" type="Label" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("1_bdrf8")
|
||||
text = "Music"
|
||||
|
||||
[node name="SliderMusic" type="HSlider" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
value = 50.0
|
||||
|
||||
[node name="Label3" type="Label" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("1_bdrf8")
|
||||
text = "SFX"
|
||||
|
||||
[node name="SliderSFX" type="HSlider" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
value = 50.0
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Button" type="Button" parent="VBoxContainer"]
|
||||
process_mode = 3
|
||||
layout_mode = 2
|
||||
theme = ExtResource("1_bdrf8")
|
||||
text = "MainMenu"
|
||||
|
||||
[node name="VBoxContainer2" type="VBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 5
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
offset_left = -139.0
|
||||
offset_right = 139.0
|
||||
offset_bottom = 78.0
|
||||
grow_horizontal = 2
|
||||
|
||||
[node name="Label" type="Label" parent="VBoxContainer2"]
|
||||
layout_mode = 2
|
||||
text = "Pause"
|
||||
label_settings = ExtResource("1_6mo0v")
|
||||
|
||||
[node name="Label2" type="Label" parent="VBoxContainer2"]
|
||||
layout_mode = 2
|
||||
text = "Press ESC to continue"
|
||||
label_settings = ExtResource("4_k4ey7")
|
||||
horizontal_alignment = 1
|
||||
|
||||
[connection signal="value_changed" from="VBoxContainer/SliderMainSound" to="." method="_on_slider_main_sound_value_changed"]
|
||||
[connection signal="value_changed" from="VBoxContainer/SliderMusic" to="." method="_on_slider_music_value_changed"]
|
||||
[connection signal="value_changed" from="VBoxContainer/SliderSFX" to="." method="_on_slider_sfx_value_changed"]
|
||||
[connection signal="pressed" from="VBoxContainer/Button" to="." method="_on_button_pressed"]
|
25
entities/pauseMenu/pause_menu.gd
Normal file
25
entities/pauseMenu/pause_menu.gd
Normal file
|
@ -0,0 +1,25 @@
|
|||
extends Control
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if (Input.is_action_just_pressed("pause")):
|
||||
visible = false if visible else true
|
||||
get_tree().paused = visible
|
||||
|
||||
|
||||
func _on_slider_main_sound_value_changed(value: float) -> void:
|
||||
var bus_index = AudioServer.get_bus_index("Master")
|
||||
AudioServer.set_bus_volume_db(bus_index, (value-50)/4)
|
||||
|
||||
func _on_slider_music_value_changed(value: float) -> void:
|
||||
var bus_index = AudioServer.get_bus_index("Music")
|
||||
AudioServer.set_bus_volume_db(bus_index, (value-50)/4)
|
||||
|
||||
|
||||
func _on_slider_sfx_value_changed(value: float) -> void:
|
||||
var bus_index = AudioServer.get_bus_index("SFX")
|
||||
AudioServer.set_bus_volume_db(bus_index, (value-50)/4)
|
||||
|
||||
|
||||
func _on_button_pressed() -> void:
|
||||
GameManager.launch_menu()
|
1
entities/pauseMenu/pause_menu.gd.uid
Normal file
1
entities/pauseMenu/pause_menu.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://catyjdq20adaf
|
|
@ -16,7 +16,7 @@ func update_control_points():
|
|||
var next = modulo_get_point_position(i + 1) - modulo_get_point_position(i)
|
||||
var prev_dir = prev.normalized()
|
||||
var next_dir = next.normalized()
|
||||
var tangent_length = next.length() / 3
|
||||
var tangent_length = next.length() / 2
|
||||
var tangent = (prev_dir + next_dir)
|
||||
|
||||
tangent.y = 0
|
||||
|
|
|
@ -7,7 +7,7 @@ domain_warp_enabled = true
|
|||
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_l5fpm"]
|
||||
seamless = true
|
||||
as_normal_map = true
|
||||
bump_strength = 2.0
|
||||
bump_strength = 1.0
|
||||
noise = SubResource("FastNoiseLite_ma6g7")
|
||||
|
||||
[resource]
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
shader_type sky;
|
||||
|
||||
uniform vec3 color_env : source_color;
|
||||
uniform sampler2D noise_texture : repeat_enable;
|
||||
uniform float noise_power;
|
||||
uniform float speed;
|
||||
|
||||
void sky() {
|
||||
COLOR = color_env * ((1.0+EYEDIR.y)/2.0) + noise_power*texture(noise_texture, SKY_COORDS + vec2(TIME*speed, 0)).xyz;
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
uid://tqpr7f3nr72k
|
47
entities/winMenu/winMenu.tscn
Normal file
47
entities/winMenu/winMenu.tscn
Normal file
|
@ -0,0 +1,47 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://n4qqt180m2fo"]
|
||||
|
||||
[ext_resource type="LabelSettings" uid="uid://cru5yoau1mluh" path="res://fonts/BigTextLabelSettings.tres" id="1_qk15a"]
|
||||
[ext_resource type="Script" uid="uid://cm6k4bbs2qbca" path="res://entities/winMenu/win_menu.gd" id="1_wb05w"]
|
||||
[ext_resource type="Theme" uid="uid://desmbsje23ubj" path="res://fonts/DefautTheme.tres" id="2_2te7r"]
|
||||
|
||||
[node name="WinMenu" type="Control"]
|
||||
process_mode = 3
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_wb05w")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -20.0
|
||||
offset_top = -20.0
|
||||
offset_right = 20.0
|
||||
offset_bottom = 20.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="Label" type="Label" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Your time :"
|
||||
label_settings = ExtResource("1_qk15a")
|
||||
|
||||
[node name="Time" type="Label" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "56s"
|
||||
label_settings = ExtResource("1_qk15a")
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="MainMenu" type="Button" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_2te7r")
|
||||
text = "MainMenu"
|
||||
|
||||
[connection signal="pressed" from="VBoxContainer/MainMenu" to="." method="_on_main_menu_pressed"]
|
12
entities/winMenu/win_menu.gd
Normal file
12
entities/winMenu/win_menu.gd
Normal file
|
@ -0,0 +1,12 @@
|
|||
extends Control
|
||||
@onready var game_ui: GameUI = $"../GameUi"
|
||||
@onready var time_label: Label = $VBoxContainer/Time
|
||||
|
||||
|
||||
func _on_check_point_manager_end_track() -> void:
|
||||
time_label.text = str(round(game_ui.time*100)/100)+"s"
|
||||
show()
|
||||
get_tree().paused = true
|
||||
|
||||
func _on_main_menu_pressed() -> void:
|
||||
GameManager.launch_menu()
|
1
entities/winMenu/win_menu.gd.uid
Normal file
1
entities/winMenu/win_menu.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://cm6k4bbs2qbca
|
Loading…
Add table
Add a link
Reference in a new issue