highscore vs score (capx)

Get help using Construct 2

Post » Tue Aug 20, 2013 12:24 pm

Hello,
every time I destroy "brick object" it adds 1 point to Score and also 1 point to Highscore. But when I want to play this level again it keeps counting where it ended.

I need 2 things to do:

- reset score when I start play again (BUT keep that score when I move to another level -> counting here is OK)

- keep the highest amount of Highscore whatever level I play - never reset it

Look at thic capx please... .capx
B
14
S
4
Posts: 110
Reputation: 1,538

Post » Tue Aug 20, 2013 1:26 pm

Event Sheet 1 > OnStartOfLayout > Score =0
This will reset Score to 0 every time but only when you restart the level, not when you go to a new level.

plinkie2013-08-20 13:27:11
B
47
S
17
G
82
Posts: 2,231
Reputation: 48,609

Post » Tue Aug 20, 2013 1:32 pm

but it also restarts Highscore and thats something I dont want to...

Dont you know how to keep the highest amount of Highscore?
B
14
S
4
Posts: 110
Reputation: 1,538

Post » Tue Aug 20, 2013 1:46 pm

B
21
S
8
G
7
Posts: 49
Reputation: 5,274

Post » Tue Aug 20, 2013 1:50 pm

I used webstorage man... Look at my capx...

But there has to be an error somewhere...trance2013-08-20 13:50:52
B
14
S
4
Posts: 110
Reputation: 1,538

Post » Tue Aug 20, 2013 2:26 pm

What you could try is use more variables.

CurrentScore
TotalHighscore
and a levelhighscore for each level

Where you add 1 to currentscore at brick destroy
add 1 to level1high if currentscore is higher than levelhigh1
and set totalhigh to level1high + level2high + level3high etc.

on layout reset and new layout, reset the currentscore to 0LittleStain2013-08-20 14:26:55
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Aug 20, 2013 2:37 pm

Sorry, I can't open the capx, I'm using the stable release
B
21
S
8
G
7
Posts: 49
Reputation: 5,274

Post » Tue Aug 20, 2013 2:59 pm

The high score doesn't restart? Please give more info about what you want.
B
47
S
17
G
82
Posts: 2,231
Reputation: 48,609

Post » Tue Aug 20, 2013 3:22 pm

I dont want my Highscore to restart every time I start play. When I achieve 100 points I want those points to be visible until someone achieves more than 100 points.
B
14
S
4
Posts: 110
Reputation: 1,538

Post » Tue Aug 20, 2013 3:28 pm

OK I understand that, but the highscore does not restart every time the level is replayed. It counts up from the previous number..
B
47
S
17
G
82
Posts: 2,231
Reputation: 48,609

Next

Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 12 guests