Skip to content

Stars system custom save count#43

Open
g-lilian wants to merge 8 commits intomasterfrom
gl
Open

Stars system custom save count#43
g-lilian wants to merge 8 commits intomasterfrom
gl

Conversation

@g-lilian
Copy link
Copy Markdown
Collaborator

@g-lilian g-lilian commented Feb 8, 2021

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

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.
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";
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

level.transform.GetChild(4).gameObject.SetActive(false);
}
else if (star == "1")
else if (saves <= savesNeeded[2]) // 3 stars
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put all the if logic for checking number of stars into a function that returns the level STATE_NUMBER.

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

Successfully merging this pull request may close these issues.

major feat: Add stars system to levels

1 participant