Conversation
Can fill in the text file to quickly store number of saves required for 1/2/3 stars for each level.
Changed BG image and removed unnecessary buttons
Changed colour of stars and buttons.
g-lilian
commented
Feb 19, 2021
| private string starprogress = ""; | ||
| // Start is called before the first frame update | ||
| void Start() | ||
| private string playerMinSaves = "0;-1;-1;-1;-1;-1;-1;-1;-1;-1"; |
Collaborator
Author
There was a problem hiding this comment.
Stretch goal:
Resetting playerMinSaves: make reset progress button.
Comment on lines
65
to
69
| level.transform.GetChild(0).gameObject.SetActive(false); | ||
| level.transform.GetChild(1).gameObject.SetActive(true); | ||
| level.transform.GetChild(2).gameObject.SetActive(false); | ||
| level.transform.GetChild(3).gameObject.SetActive(false); | ||
| level.transform.GetChild(4).gameObject.SetActive(false); |
Collaborator
Author
There was a problem hiding this comment.
Refactor by moving into a class LevelIcon. Expose a way to change the icons (5 states: 0 star, 1 star, 2 star, 3 star, locked). LevelIcon.showIcon(SOME_STATE_NUMBER).
Assets/Scripts/SceneLoader.cs
Outdated
| level.transform.GetChild(4).gameObject.SetActive(false); | ||
| } | ||
| else if (star == "1") | ||
| else if (saves <= savesNeeded[2]) // 3 stars |
Collaborator
Author
There was a problem hiding this comment.
Put all the if logic for checking number of stars into a function that returns the level STATE_NUMBER.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You can specify the save count required to obtain 1/2/3 stars for each level in the starinfo.txt file found in Assets/Resources. Refactored the logic for Goal.cs and SceneLoader.cs.
Fixes #5