Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue: lose all score when retry level #38

Open
PartTimeCode opened this issue Jun 10, 2020 · 1 comment
Open

Issue: lose all score when retry level #38

PartTimeCode opened this issue Jun 10, 2020 · 1 comment

Comments

@PartTimeCode
Copy link

Not sure if this has been addressed but I notice in my game after completing a couple of levels and I die and retry, all score is lost from previous levels, I fixed this by adding another variable to PlayerData "level_score" with a setget and make ememys and coins add there score to this, then I add the level score to the total score in the portal and make the user interface add the scores for display "score.text = "Score: %s" % str(PlayerData.score+PlayerData.level_score)"

now when I die I only lose the score for that level.

Fantastic tutorial BTW

@Kaiser11235
Copy link

@PartTimeCode could you show the changes made to "PlayerData.gd"? I see you put the change to the %s for game interface score but I am not sure exactly how I am supposed to code the function for level_score so that it actually only takes the totals from that specific scene.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants