How do I fix my high score? [Please Help]

Get help using Construct 2

Post » Tue May 28, 2013 8:10 am

Yea man, that's the exact tutorial I followed and it worked perfectly before you help me reset back to 0, but now it seems broken. I mean, how is it never setting a high score? I don't get it, I didn't change anything. All I did was set the value back to 0, right?

Please, it would really help me out if you showed me a code example...
B
27
S
5
G
1
Posts: 590
Reputation: 3,253

Post » Tue May 28, 2013 11:24 am

Hey ArcadEd, can you still help me out:)?
B
27
S
5
G
1
Posts: 590
Reputation: 3,253

Post » Tue May 28, 2013 1:54 pm

Have you tried Set local value -> varHighScore -> 0?CostructingLife2013-05-28 13:57:03
B
3
Posts: 3
Reputation: 181

Post » Tue May 28, 2013 2:03 pm

Where in your code are you saving the high score to web storage? I don't see it in the snippet you posted.

Do you mind posting up a CAPX?ArcadEd2013-05-28 14:04:23
B
100
S
31
G
11
Posts: 1,552
Reputation: 21,502

Post » Tue May 28, 2013 10:56 pm

You shoot the eyes with the spacebar to move on and see the High score, but for some reason, it just always remains at 0.


Thanks again for the help.guannstar2013-05-29 05:42:23
B
27
S
5
G
1
Posts: 590
Reputation: 3,253

Post » Wed May 29, 2013 12:06 am

ArcadeEd, could you still help me out?
B
27
S
5
G
1
Posts: 590
Reputation: 3,253

Post » Wed May 29, 2013 12:25 am

How do you know the High Score is staying at 0?

I don't see anyplace you are updating the high score text with the high score. Does that make sense?

On start of layout you are setting the text of the HighScore text object to varHighscore.

But you never update the text box if the highscore is beaten. So it's always showing whatever the high score was when you start the game.



ArcadEd2013-05-29 00:35:04
B
100
S
31
G
11
Posts: 1,552
Reputation: 21,502

Post » Wed May 29, 2013 12:51 am

Hey, I changed it the way you told me to, but it still doesn't work...

Can you fix the capx and then, post it, please? What am I doing wrong now lol?
B
27
S
5
G
1
Posts: 590
Reputation: 3,253

Post » Wed May 29, 2013 1:06 am

Well there are many places in your code where that same line of code I highlighted is used.

Basically, Text objects are not updated automatically, so any time you change the variable that you are showing with a text object, you need to set the text to the variable again.

Or set them to update every tick.
B
100
S
31
G
11
Posts: 1,552
Reputation: 21,502

Post » Wed May 29, 2013 1:53 am

Can you please show me with the capx I sent you? I just need a visual idea of what you're talking about man. I mean, I get it , but I don't get exactly how to do it. Can you please show me? It would be the biggest help...
B
27
S
5
G
1
Posts: 590
Reputation: 3,253

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, ilyaTyl and 11 guests