Save only best scores? Capx. included.

Get help using Construct 2

Post » Thu Dec 20, 2012 7:02 pm

I`ve asked on the forum few times and no real answer. I want to save only best scores, in my case shorter time, better score.

I tried many different ways to solve this problem, think i am quite close now, but i miss something.

I add this capx. so you can help me and in some way i`ll help you if you need my idea on how to make flying helicopter, control with W,A,S and D.

http://dl.dropbox.com/u/67937942/heli.capx

Help pls... i have 3 finished games waiting only scores to be added all on the same base.
B
10
S
3
G
3
Posts: 54
Reputation: 3,317

Post » Thu Dec 20, 2012 7:21 pm

Is this version with or without your try at a highscore system?TheNormalGeek2012-12-20 19:23:08
(\__/)
(='.'=)
(")_(")
B
20
S
9
G
1
Posts: 68
Reputation: 3,057

Post » Thu Dec 20, 2012 7:23 pm

There is a highscore, but need to be fixed, only to save best scores.
B
10
S
3
G
3
Posts: 54
Reputation: 3,317

Post » Thu Dec 20, 2012 7:37 pm

I don't have time right now to look over your project, but here's how to do it!

Create 2 global variables,
SCORE
BESTSCORE

when you run your game you will operate with the score(init with 0), and at the end of the game, compare score with bestscore, if score > bestscore then bestscore = score
B
15
S
3
G
2
Posts: 42
Reputation: 2,412

Post » Thu Dec 20, 2012 7:43 pm

Ok, the things you need to do/fix:

In eventsheet[GAME] Event#8:
The system will always check after this value and therefore when "Timelim" starts at 0 the system will see that and record it as "StoredScore".

You will need another variable that tells the game if the game is still going on. This can be called "Ingame".
That means Event#8 should look like:


Remember when the game ends you need "Ingame=0"

In eventsheet[MENU] Event#2:
Add a Set "Savescore" to 0

You will also need the savedscore to be something like "9999999" so it will always save the score from the first go.
(When "savedscore" starts at 0 it wont move because <="savedscore" is already written as [Less or Equal to 0])


Might be hard to understand, but if you dont, just ask. (Began with construct 4days ago)TheNormalGeek2012-12-20 19:46:32
(\__/)
(='.'=)
(")_(")
B
20
S
9
G
1
Posts: 68
Reputation: 3,057

Post » Thu Dec 20, 2012 8:12 pm

If you can change the capx. it will be great. My brain can`t understand saving with construct 2...
B
10
S
3
G
3
Posts: 54
Reputation: 3,317

Post » Thu Dec 20, 2012 8:16 pm

Ill do, just give me a couple of minutes and ill update this post.
(\__/)
(='.'=)
(")_(")
B
20
S
9
G
1
Posts: 68
Reputation: 3,057

Post » Thu Dec 20, 2012 8:26 pm

Ok, no problem
B
10
S
3
G
3
Posts: 54
Reputation: 3,317

Post » Thu Dec 20, 2012 8:49 pm

https://www.dropbox.com/s/hvkgz63g1wiixjz/heli.capx

Link to the file, with highscores (Changed some of the names used)TheNormalGeek2012-12-20 20:51:46
(\__/)
(='.'=)
(")_(")
B
20
S
9
G
1
Posts: 68
Reputation: 3,057

Post » Thu Dec 20, 2012 9:12 pm

Ok, so i press play, finish the lvl in 7 seconds. In menu it says Score: 7, Highscore: 0, than i close the browser, and start the game from the beginning, finish the game in 9 seconds and in menu it shows Score: 9, Highscore: 0, i don`t see the problem solved here :), btw if you start directly in menu it shows Score:0, Hiscore: 0, so nothing is saved.


[QUOTE=wildmedia]
Create 2 global variables,
SCORE
BESTSCORE

when you run your game you will operate with the score(init with 0), and at the end of the game, compare score with bestscore, if score > bestscore then bestscore = score[/QUOTE]

i`ve tried this few months ago, but no result, maybe i missed something, if you think you can do it, pls fix the capx.


B
10
S
3
G
3
Posts: 54
Reputation: 3,317

Next

Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 12 guests