credit
This commit is contained in:
+44
-24
@@ -3,20 +3,27 @@ extends Node3D
|
||||
@onready var camera: Camera3D = $Camera3D
|
||||
|
||||
# BOUTONS
|
||||
@onready var start: Button = $HBoxContainer/Start
|
||||
@onready var quit: Button = $HBoxContainer/Quit
|
||||
@onready var credit: Button = $HBoxContainer/Credit
|
||||
@onready var start: Button = $MenuUI/HBoxContainer/Start
|
||||
@onready var quit: Button = $MenuUI/HBoxContainer/Quit
|
||||
@onready var credit: Button = $MenuUI/HBoxContainer/Credit
|
||||
|
||||
@onready var fr: TextureButton = $HBoxContainer/fr
|
||||
@onready var en: TextureButton = $HBoxContainer/en
|
||||
@onready var screen: Button = $HBoxContainer2/Screen
|
||||
@onready var fr: TextureButton = $MenuUI/HBoxContainer/fr
|
||||
@onready var en: TextureButton = $MenuUI/HBoxContainer/en
|
||||
@onready var screen: Button = $MenuUI/HBoxContainer2/Screen
|
||||
|
||||
@onready var credit_label: Label = $Sprite3D/SubViewport/credit_label
|
||||
@onready var credit_label: Label = $MenuUI/Sprite3D/SubViewport/credit_label
|
||||
|
||||
var but_credit_exist : bool = true
|
||||
@onready var car: Node3D = $partie3D/car
|
||||
@onready var anim_player_car: AnimationPlayer = $partie3D/car/AnimationPlayer
|
||||
@onready var anim_player_char: AnimationPlayer = $partie3D/car/player_driving/AnimationPlayer
|
||||
|
||||
@onready var musique: AudioStreamPlayer3D = $Musique
|
||||
|
||||
# pour option
|
||||
@onready var menu_ui: Control = $MenuUI
|
||||
@onready var option: CanvasLayer = $Option
|
||||
@onready var optionexit: Button = $Option/optionexit
|
||||
|
||||
var cible_rot_y
|
||||
var cible_rot_x
|
||||
|
||||
func _ready() -> void:
|
||||
Sauvegarde.is_in_menu = true
|
||||
@@ -26,10 +33,18 @@ func _ready() -> void:
|
||||
en.texture_normal = preload("uid://bdcehsogmfiv2")
|
||||
fr.texture_normal = preload("uid://dusujvur4igj4")
|
||||
screen.text = Sauvegarde.get_text("window_screen")
|
||||
if Sauvegarde.can_see_credit:
|
||||
credit.visible = true
|
||||
else:
|
||||
credit.visible = false
|
||||
|
||||
cible_rot_y = deg_to_rad( 147.8 )
|
||||
cible_rot_x = deg_to_rad( -6.1 )
|
||||
anim_player_car.play("driving")
|
||||
anim_player_char.play("driving")
|
||||
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
car.position.z += 16 * delta
|
||||
|
||||
func _on_start_pressed() -> void:
|
||||
get_tree().change_scene_to_file( "res://scenes/main.scn" )
|
||||
@@ -38,15 +53,8 @@ func _on_start_pressed() -> void:
|
||||
func _on_quit_pressed() -> void:
|
||||
get_tree().quit()
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
camera.rotation.y = lerp_angle(camera.rotation.y, cible_rot_y, 3 * delta)
|
||||
camera.rotation.x = lerp_angle(camera.rotation.x, cible_rot_x, 3 * delta)
|
||||
|
||||
func _on_credit_pressed() -> void:
|
||||
cible_rot_y = deg_to_rad(100)
|
||||
cible_rot_x = deg_to_rad(16)
|
||||
credit.queue_free()
|
||||
but_credit_exist = false
|
||||
Transition.change_scene("res://ui/credit.tscn")
|
||||
|
||||
|
||||
func _on_fr_pressed() -> void:
|
||||
@@ -73,11 +81,23 @@ func load_lang(l):
|
||||
Sauvegarde.language = l
|
||||
start.text = Sauvegarde.get_text("start")
|
||||
quit.text = Sauvegarde.get_text("quit")
|
||||
if but_credit_exist :
|
||||
credit.text = Sauvegarde.get_text("credit")
|
||||
credit.text = Sauvegarde.get_text("credit")
|
||||
optionexit.text = Sauvegarde.get_text("resume")
|
||||
|
||||
if get_window().mode == Window.MODE_FULLSCREEN:
|
||||
screen.text = Sauvegarde.get_text("window_screen")
|
||||
else:
|
||||
screen.text = Sauvegarde.get_text("full_screen")
|
||||
|
||||
credit_label.text = Sauvegarde.get_text("credit_detail")
|
||||
|
||||
|
||||
func _on_timer_timeout() -> void:
|
||||
musique.play()
|
||||
|
||||
|
||||
func _on_option_pressed() -> void:
|
||||
option.visible = true
|
||||
menu_ui.visible = false
|
||||
|
||||
func _on_optionexit_pressed() -> void:
|
||||
option.visible = false
|
||||
menu_ui.visible = true
|
||||
|
||||
Reference in New Issue
Block a user