Adding a scoreboard.

Hey GS community :) , I wonder if you could help me out...

I am trying to create a scoreboard system in my game, so the player can look back and see their 3 best scores.

I have managed to add a scoring system (and a display for it), by giving the player one point every second.

The problem is that I cannot work out how to make it so I can store the players top 3 scores, and display them in the scoreboard scene.

I have included some screenshots of my work below (in the google docs file):
Screenshots

Thanks for your time and help :smile: , have a great day!

Comments

  • whycaliwhycali Member, PRO Posts: 87
    edited October 2017

    You will most likely need to use a table to store the 3 best scores. I personally do not know how to do it but I think tables would be a good start.

    You can also search the forum i found a lot of different ways to do it there. Good Luck

    ~WhyCali

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited October 2017

    If game.score ≥ game.firstHighest
         change attribute game.firstHighest to game.score
         Else
              if game.score ≥ game.secondHighest
                   change attribute game.secondHighest to game.score
                   Else
                        if game.score ≥ game.thirdHighest
                             change attribute game.thirdHighest to game.score

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • Two.ETwo.E Member Posts: 599

    Made a template that should help. It does use the Loop behaviour and a Table. So I add in some brief notes to help guide.
    Its very simple.

    Download Here!

    Note: The table has pre-made scores in it. If you want the leaderboard to be empty at the start, simply delete the data in the table rows.

    Hope it helps.
    Best,
    Two.E

  • Ben :)Ben :) Member Posts: 8
    edited October 2017

    @Two.E said:
    Made a template that should help. It does use the Loop behaviour and a Table. So I add in some brief notes to help guide.
    Its very simple.

    Download Here!

    Note: The table has pre-made scores in it. If you want the leaderboard to be empty at the start, simply delete the data in the table rows.

    Hope it helps.
    Best,
    Two.E

    @tatiang said:
    If game.score ≥ game.firstHighest
         change attribute game.firstHighest to game.score
         Else
              if game.score ≥ game.secondHighest
                   change attribute game.secondHighest to game.score
                   Else
                        if game.score ≥ game.thirdHighest
                             change attribute game.thirdHighest to game.score

    @whycali said:
    You will most likely need to use a table to store the 3 best scores. I personally do not know how to do it but I think tables would be a good start.

    You can also search the forum i found a lot of different ways to do it there. Good Luck

    ~WhyCali

    Thanks so much everyone! I now have a working leaderboard :)

Sign In or Register to comment.