- Fixing Commit

This commit is contained in:
megamichi 2024-10-22 19:52:35 +02:00
parent d92086f600
commit 78b4a3bba2
14 changed files with 133 additions and 66 deletions

View file

@ -28,4 +28,6 @@ func _on_restart_pressed() -> void:
await $AnimationPlayer.animation_finished
hide()
func _on_back_pressed() -> void:
$"/root/Global".reset_game()

View file

@ -45,3 +45,13 @@ func write_save():
)
print("saved: ",content)
data.store_string(content)
func reset_game():
speed = 100
score = 0
active_biom = "n"
gamerunning = false
_ready()
$/root/Game/Fade/FadeAnimation.play("fade")
get_tree().reload_current_scene()

View file

@ -1,6 +1,7 @@
extends Node
func _ready() -> void:
$Fade/FadeAnimation.play_backwards("fade")
$Screen/Background/Floor/EasterEggFixCollision.disabled = false
$Gui/HiscoreContainer.show()
%ScoreContainer.hide()
@ -18,6 +19,7 @@ func start_game():
$"/root/Global".start.emit()
$"/root/Global".score = 0
$"/root/Global".speed = 100
print("game started")
func _on_level_up_timer_timeout() -> void:
if $"/root/Global".speed < $"/root/Global".maxspeed:
@ -30,7 +32,3 @@ func _score() -> void:
elif $Screen/Duck.alive:
$"/root/Global".score += 10
%ScoreContainer/score.text = str($"/root/Global".score)
func _process(delta):
pass