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

Learn to create a 2d platform game with the Godot game engine. This is a beginner programming tutorial.
MIT License
365 stars 96 forks source link

Not Really a bug... #33

Closed zxKyoZxz closed 4 years ago

zxKyoZxz commented 4 years ago

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

zxKyoZxz commented 4 years ago

I've just seen that was already solved sorry

NathanLovato commented 4 years ago

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. 😄