How do I respawn a global object

Get help using Construct 2

Post » Sun Nov 23, 2014 6:43 pm

Anyone have any ideas how to respawn a global object, like a player after they die?

My game is currently set up so that the player is a global object, upon hitting zero health it's destroyed and after 5 seconds you get sent to the Game Over screen/layout.
After you die if you go back to the Main Menu and restart a new game, the player is no longer present even though it's a new game.

Does anyone have any idea how to reset global objects? Sort of like Global variables.

Just for safety measures in-case I get no answer, @Tokinsom
The moderators are corrupt and ban for no reason, especially that condescending neckbeard asshole Kyatric. The forums are filled with fanboys.
Banned User
B
22
S
7
G
1
Posts: 558
Reputation: 2,925

Post » Sun Nov 23, 2014 9:28 pm

,,,,,,,,,,,,
You do not have the required permissions to view the files attached to this post.
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Mon Nov 24, 2014 6:11 am

You could set your player object to be invisible instead of destroying it and maybe add an instance variable storing the current dead state, so other objects can check if they can interact with your player or not. Then you would add an init function, where you set initial object values, position etc.
B
19
S
2
G
1
Posts: 24
Reputation: 1,475

Post » Mon Nov 24, 2014 8:31 pm

@korbaach It's a bit harder than that since it's not one object but 3, and a lot of the layouts use the same event sheets.

@moonworX Pretty good idea, I'll definitely try that! Also "init" function?
The moderators are corrupt and ban for no reason, especially that condescending neckbeard asshole Kyatric. The forums are filled with fanboys.
Banned User
B
22
S
7
G
1
Posts: 558
Reputation: 2,925


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 18 guests