How do I respawn a player with variables still counting?

Get help using Construct 2

Post » Sun Sep 11, 2016 8:22 pm

It seems that I can't make the "Mario" Life system to work.

The way I made this is to have a RPG like HP and when it runs out to 0, it subtracts the lives variable to 2.

It wasn't till the end I found out from my friend that restart layout actually restarts the variables as well, so I am not sure on how to spawn the player keeping the variables while the enemy and everything else resets.

Tried searching around with no solutions to this.
B
7
Posts: 26
Reputation: 332

Post » Sun Sep 11, 2016 8:39 pm

You need to use a global variable for lives. When you restart the layout, it creates a new instance of the objects and instance variables will be set to default, whereas global variables will remain unchanged.
B
47
S
17
G
81
Posts: 2,223
Reputation: 48,093

Post » Sun Sep 11, 2016 8:42 pm

It worked! Thanks a lot man.
B
7
Posts: 26
Reputation: 332


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, Felipiwi, Yahoo [Bot] and 18 guests