Scoreboard Help Needed!

I have a scoring system that ranges from 0-1100.
I need to have a highscore feature which saves the score closest to 1000. I currently have the highest score being saved and displayed on the game's main menu but I don't know how to make scores above 1000 that are further away from the current score not count. Example:
High score 990 is worse than high score 1005, so I would want 1005 displayed. However...
High score 995 is better than high score 1010, but currently it would display 1010.

Any suggestions would be greatly appreciated :)

Comments

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    You need to use a couple of math expressions and then compare the sums. You would need to store the sums in self attributes in the actor that computes the score.

    Self attributes

    Score -
    Score +

    Rule.

    If score is < 1000

    Change attribute score- to 1000 - score


    Rule.

    If score is > 1000

    Change attribute score+ to score - 1000


    Rule

    If score- < score +

    Add to high score


    Rule if score + < score -

    Add to high score
  • CharlieG97CharlieG97 Member Posts: 52
    You need to use a couple of math expressions and then compare the sums. You would need to store the sums in self attributes in the actor that computes the score.

    Self attributes

    Score -
    Score +

    Rule.

    If score is < 1000

    Change attribute score- to 1000 - score


    Rule.

    If score is > 1000

    Change attribute score+ to score - 1000


    Rule

    If score- < score +

    Add to high score


    Rule if score + < score -

    Add to high score
    Sorry for the late reply, I appreciate the help!
    I'm writing all the rules and I'm just stuck on one thing. With the last 2 rules where you've put "Add to high score" how exactly do I do this.
    Change attribute game.highscore to ??
    What do I put in place of the question marks?
    Thanks.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited November 2013
    Here's a slightly different way to do it (see attached demo).

    image

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

  • CharlieG97CharlieG97 Member Posts: 52
    edited November 2013
    Here's a slightly different way to do it (see attached demo).
    Just took a quick look and it seems perfect. Will have to look at it in more detail tomorrow though. Thanks for the help as usual :)
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    You're welcome. Let me know if you have any questions.

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

Sign In or Register to comment.