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

Get help using Construct 2

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
34
S
9
G
1
Posts: 628
Reputation: 3,904

Post » Wed May 29, 2013 2:09 am

Well, I'm having a hard time with your CAPX because there seems to be the same event blocks in several places and I'm not sure why.

Right now in your game. Where are you wanting me to put the code so you can test it? Which line number?
B
101
S
32
G
11
Posts: 1,546
Reputation: 21,667

Post » Wed May 29, 2013 2:49 am

Can you put it right end (line 77)? If not, just put it wherever you feel is best. Thanks a lot.
B
34
S
9
G
1
Posts: 628
Reputation: 3,904

Post » Wed May 29, 2013 2:57 am

That's just at the bottom, it won't solve the issue. I'm probably just not explaining myself well enough.

The flow of the game should be something like this.
1. Start game, import high score (if one exists) and set it to varHighscore. Set text highscore to varHighscore
2. Play game, player earns score.
3. When game is over, check if the score is larger than varHighscore
If it is, set webstorage high score to SCORE.
4. Restart layout since the game is now restarting because it's game over. Upon restarting the layout, you go back to step 1.

Just sticking the code in the bottom of you current code isn't going to solve the problem.
B
101
S
32
G
11
Posts: 1,546
Reputation: 21,667

Post » Wed May 29, 2013 3:04 am

I here what you're saying, but can you PLEASE show me the capx? I really need to see it to understand what your saying lol. I'm lost without a visual.
B
34
S
9
G
1
Posts: 628
Reputation: 3,904

Post » Wed May 29, 2013 3:18 am

I just don't know where to put the code so you can test it. I'm a bit confused by your code, which is why it's making it difficult. I don't know where exactly you want the high score to show up for the player to see.

I'm sorry, I really trying to help.


B
101
S
32
G
11
Posts: 1,546
Reputation: 21,667

Post » Wed May 29, 2013 3:31 am

Oh, I see, I want the High Score to show up everytime the player wins or looses (on the "gameWin" and "gameOver" layers). I don't want them to see the High Score while they're actually playing. They should only see their score while actually playing.
B
34
S
9
G
1
Posts: 628
Reputation: 3,904

Post » Wed May 29, 2013 4:03 am

Gotcha, I am just creating a function and you can call it whenever you need to fetch the score or update it.
B
101
S
32
G
11
Posts: 1,546
Reputation: 21,667

Post » Wed May 29, 2013 4:07 am

Thanks a lot man:)
B
34
S
9
G
1
Posts: 628
Reputation: 3,904

Post » Wed May 29, 2013 4:12 am

Ok, new capx. Let me know if something doesn't make sense.
http://www.arcadeinabox.com/guannstar.capx



The Function
ArcadEd2013-05-29 04:13:18
B
101
S
32
G
11
Posts: 1,546
Reputation: 21,667

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: ditocruz, RalleRoyal and 31 guests