Score ranking

GamepencilerGamepenciler Artist/Game DeveloperMember, PRO Posts: 326
edited May 2014 in Working with GS (Mac)

Hello all, I have a question
I'm trying to make a score ranking code example:

Hi-score: 2300

Rank A: 2300

Rank B: 1500

Rank C: 800



But I tried putting :

If Hi-score >= RankA

change attribute RankA = Hi-score

If RankA>= RankB

change attribute RankB= RankA

If RankC>= RankB

change attribute RankC= RankB

It seems to be working if it is played continuously but if you're not playing and when i go back to the score scene for couple of times all ranks were numbered 2300 because it is overwriting the low score with a greater score.

Result: (over written even if not playing)


Hi-score: 2300

Rank A: 2300

Rank B: 2300

Rank C: 2300



I want it not to overwrite. What do you guys think is wrong with my code?

need help thanks,
-ACE

Artist/Game Developer / Animator at your service..

Comments

  • TosanuTosanu Member, PRO Posts: 388

    There is one important piece of information we need to check in your code. When does this trigger?

  • GamepencilerGamepenciler Artist/Game Developer Member, PRO Posts: 326

    it triggers every-time i go back to the score scene. It means every time I go in the greater value is being put to the next rank instead of staying put.

    Artist/Game Developer / Animator at your service..

  • TosanuTosanu Member, PRO Posts: 388

    You have no conditionals preventing it from doing this. In fact, reading your code, it seems designed specifically to have the higher numbers copy down to the lower numbers. You have it say if rank 1 is greater than rank 2, turn rank 2 INTO rank 1, and so on. I am afraid I do not understand what the code is trying to do.

Sign In or Register to comment.