How save the score for whole game?

Get help using Construct 2

Post » Wed Sep 03, 2014 7:03 am

Hi there! I search through the forum, but didn't find what I need to. So, right now I'm working on my new game and I have there a "Dead score" - value of how many times you died on one layout. Just like in Dead Rising-games: number of killed zomibes, I have of how many times you have died. I got this stuff, but it's don't work on all layouts in the game, only on one at the time.

I need to make that the score will keep collecting number (every time player are dead it's +1 to score), when player is making through the game (coming from one layout to next). Give me some variables or expressions to make that thing work. I guess you'll understand what I mean.
B
6
Posts: 11
Reputation: 328

Post » Wed Sep 03, 2014 7:09 am

Try global variable?
Are you using local variable for the score?
B
28
S
8
G
4
Posts: 553
Reputation: 4,924

Post » Wed Sep 03, 2014 7:46 am

I'm using global one, but where I need to put events so that system will work?
B
6
Posts: 11
Reputation: 328

Post » Wed Sep 03, 2014 8:02 am

Deep wolf wrote:I'm using global one, but where I need to put events so that system will work?

Global variable should be accessible by any eventsheet(ES), your option is either to have a global ES and include it in all level ES or just update you global variable in each level ES. I recommend using global ES so that you won't have to repeat your event for each level.
B
28
S
8
G
4
Posts: 553
Reputation: 4,924

Post » Wed Sep 03, 2014 8:09 am

DuckfaceNinja wrote:or just update you global variable in each level ES. I recommend using global ES so that you won't have to repeat your event for each level.
How to do that? For example: on first layout player died 5 times, so I need to to have that 5 on start of next layout. What do I need to write in ES?
B
6
Posts: 11
Reputation: 328

Post » Wed Sep 03, 2014 8:14 am

Deep wolf wrote:How to do that? For example: on first layout player died 5 times, so I need to to have that 5 on start of next layout. What do I need to write in ES?


Global variable: Death=0
Condition: player died
Action: add 1 to Death

This is a very basic question, I suggest go through tutorial as their explanation is much better and complete.
B
28
S
8
G
4
Posts: 553
Reputation: 4,924

Post » Wed Sep 03, 2014 8:21 am

create global variable. (content number = 5 )

example in ES : if colission with enemy then substract global variable 1 (so 5 times will game over)

if score change substract to add (number value)

imho

mochiz
B
5
Posts: 17
Reputation: 261

Post » Wed Sep 03, 2014 8:32 am

Okay, this is obvious, I already did that before made a topic.
When I'm going to the next layout the score isn't the same...

Wow, I'm an idiot. I put "set to 0" on every layout, so score is changing on 0 every time. Really disappointed in myself.
Thanks for answers and sorry for wasted time -_-

Please delete this topic, admin or some one else.
B
6
Posts: 11
Reputation: 328


Return to How do I....?

Who is online

Users browsing this forum: David181 and 10 guests