top of page
James Burke

Match 3 Unity #7 - Basic Score Count

Making a beginning on score counting, I start by implementing the basic score- one which is incremented each time a match is made, giving 1 point per element matched.

Scoring mechanics will be developed further to eventually be used in win/loss conditions as well as become more specific as a means of giving the player specific objectives on each level to reach.

Each level contains a prefab instance of "Level Manager". This will be responsible for handling transitions between levels, as well as serving as a progression tracker for the level.

The 'Score' variable is used to keep track of score right now, as there has not been a UI set up yet to show this.



Within the progression tracker script:

    public void UpdateProgress(int elementsClearCount)
    {
        Score += elementsClearCount;
    }

This function handles the increase in score. A seperate object, the "Board Manager" contains the script where matches are detected- it is pretty much responsible for anything to do with matches and clearing them. Therefore it makes sense to call this functionality from there (after setting up the necessary references):

This part of the code is specifically where the score can be updated. Matches are found, and the number of elements that are matched are used to update the score (a match of 4 will give a higher score than match of 3, for instance).


Commentaires


bottom of page