- Musik Hinzugefügt

- Settings für Musik
- Angefangen mit Wüstenbiom
- Wolken Texture fix
This commit is contained in:
megamichi 2024-10-08 20:53:45 +02:00
parent 9a2b3c1677
commit 4676b83b61
25 changed files with 410 additions and 53 deletions

6
code/GUI/gui.gd Normal file
View file

@ -0,0 +1,6 @@
extends Control
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
show()

View file

@ -1,8 +1,12 @@
extends TextureRect
var audio_bus_music = 1
var audio_bus_sounds = 2
var sound_button_on_of = {true:preload("res://assets/GUI/sound button.png"),false:preload("res://assets/GUI/sound button off.png")}
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
#$"../../Audio/Duckrun".volume_db = linear_to_db(20*0.01)
$AnimationPlayer.play_backwards("out-in")
hide()
@ -21,3 +25,13 @@ func _on_back_pressed() -> void:
await $AnimationPlayer.animation_finished
hide()
$"../StartSchild"._ready()
func _volume_slider_changed(value: float) -> void:
AudioServer.set_bus_volume_db(audio_bus_music,linear_to_db(value*0.01))
func _on_sound_button_toggled(toggled_on: bool) -> void:
$SoundToggleButton.texture_normal = sound_button_on_of[AudioServer.is_bus_mute(audio_bus_sounds)]
AudioServer.set_bus_mute(audio_bus_sounds,not AudioServer.is_bus_mute(audio_bus_sounds))

View file

@ -1,5 +1,8 @@
extends Node
var biom_n = preload("res://assets/Ground/normal.png")
var biom_n_w = preload("res://assets/Ground/normal_wueste.png")
var biom_w = preload("res://assets/Ground/wueste.png")
func _ready() -> void:
$Screen/Background/Floor/EasterEggFixCollision.disabled = false
@ -34,10 +37,9 @@ func _process(delta):
var bla = (background_size_x) + $Screen/Background/Sprite.position.x
print(background_size_x)
print(bla)
if $"/root/Global".gamerunning:
$Screen/Background/Sprite.position.x -= $"/root/Global".speed*delta
if bla <= 0:
#$Screen/Background/Sprite.texture =biom_n_w
$Screen/Background/Sprite.position.x = 0