How do I make my highscore works?

Get help using Construct 2

Post » Wed Jun 08, 2016 9:42 pm

I dunno what I'm missing.

Two things I'm not been managing to do:

- Make SCORE stop counting after game over without using time scale 0;
- Make HighScore don't reset (I followed a guide from forums to make this one).

Any hints please? Thanks guys!

https://www.dropbox.com/s/r37lxa2ccdte4 ... .capx?dl=0
B
14
S
3
Posts: 40
Reputation: 925

Post » Wed Jun 08, 2016 10:13 pm

Hey, I'm away from home and on my laptop I just have the free edition. I can't make changes to your code but it looks like you aren't actually creating the local storage key when it's missing (If this is not the right way to go, someone please correct me - it's been awhile since I've implemented storage).
B
69
S
40
G
24
Posts: 356
Reputation: 18,314

Post » Thu Jun 09, 2016 6:08 am

Hi i have seen you capx you have to add 1 condition only
where
every tick >>> Add Block.Bullet.Speed * dt to totalDistance

Add Condition under every tick >>
Player is visible

I am trying to save your high score but every restart local storage item clears automatically
may be you have done something wrong
i don't have read your all events
Image
B
68
S
40
G
48
Posts: 680
Reputation: 34,066

Post » Thu Jun 09, 2016 6:12 am

1) TO make the score reset == System--on start of layout---score---set to 0

2)Your in luck I made an official tutorial on local storage save and included a full game capx file, its simple

https://www.scirra.com/tutorials/5343/h ... -game-capx

After you try it let me know if you have any problems.
Check out my awesome Android Game releases https://play.google.com/store/apps/deve ... ames&hl=en
B
38
S
18
G
24
Posts: 682
Reputation: 16,615

Post » Fri Jun 10, 2016 6:28 pm

EDITED: Problem is now other, check post below!
Last edited by codexsg on Fri Jun 10, 2016 7:10 pm, edited 1 time in total.
B
14
S
3
Posts: 40
Reputation: 925

Post » Fri Jun 10, 2016 7:08 pm

PixelPower wrote:1) TO make the score reset == System--on start of layout---score---set to 0

2)Your in luck I made an official tutorial on local storage save and included a full game capx file, its simple

https://www.scirra.com/tutorials/5343/h ... -game-capx

After you try it let me know if you have any problems.


Hey, tried your tutorial, it looks great!

Worked almost perfectly. but now everytime the highscore is being replaced by the last score, not the highest! What should I add to fix that?

https://www.dropbox.com/s/ai3en27t26cdk ... .capx?dl=0
B
14
S
3
Posts: 40
Reputation: 925

Post » Sat Jun 11, 2016 3:00 pm

Bump!

Its almost working, but the new highscore resets the last, even if its less:

https://www.dropbox.com/s/y86u07lkyc6zz ... .capx?dl=0
B
14
S
3
Posts: 40
Reputation: 925

Post » Mon Jun 13, 2016 2:58 am

codexsg wrote:Bump!

Its almost working, but the new highscore resets the last, even if its less:

https://www.dropbox.com/s/y86u07lkyc6zz ... .capx?dl=0


Ok I see the problem you didnt save the highscore when you ship collides with something thats why it resets the highscore.

Add this to your collision events

Local Storage --Set Item--" your key" to "your variable"
Check out my awesome Android Game releases https://play.google.com/store/apps/deve ... ames&hl=en
B
38
S
18
G
24
Posts: 682
Reputation: 16,615

Post » Thu Jun 16, 2016 2:49 pm

@codexsg Did you make the changes to the game?
Check out my awesome Android Game releases https://play.google.com/store/apps/deve ... ames&hl=en
B
38
S
18
G
24
Posts: 682
Reputation: 16,615


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 26 guests