gdquest-demos/godot-3-beginner-2d-platformer

Not Really a bug...

Closed this issue · 2 comments

Hi, Thanks for sharing ur tutorial :)
I think there is a little issue with the game, if u have a score and then u go to the level 2,when u select retry in the pause menu, ur score will reset to zero and not to the start score of the level.
so may be the retry button have to point at the first scene and not reload the current scene Or
we can implement a variable. But it's not really a bug but a way of thinking the retry function.

So i've implemented the retry button like this:

extends Button

onready var start_score: = PlayerData.score

func _on_button_up():
PlayerData.score = start_score
get_tree().paused = false
get_tree().reload_current_scene()

what do u think?
(srry for my bad english)

Best regards,
Kyo

I've just seen that was already solved sorry

No worries! I haven't had time to test the bug, that's why I hadn't replied yet. I didn't remember it was fixed. 😄