How do I get my character to respawn after dying?

Get help using Construct 2

Post » Wed May 28, 2014 10:11 pm

This is my second day, so I am obviously very new. I was using one of the tutorials to set up a simple game. Now I'm trying to add a few things. Added a few explosions, sounds, and now I want my character to be able to respawn a few seconds after dying; I'd also like it to set the score back to zero, but I think I know how to do that much.
This is the event I tried to do:
Image
First, I did not add the action to make the system wait to go to the next action. I started with the simple respawn to see if he would appear immediately after being destroyed, which he did. But after I added the action to make the system wait before going to that respawn action, it no longer does anything. Well, all the monsters still move, but the character never reappears. I'm not entirely sure what I did wrong, so now I'm asking for a little assistance. Thanks in advance! :)
B
4
Posts: 3
Reputation: 206

Post » Thu May 29, 2014 12:03 am

Why not just make your player invisible ?
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499

Post » Thu May 29, 2014 1:06 am

So here is what is happening. Because you added the system wait, the player--> spawn object isn't going to work because the player is long gone (there is no player to create the object). So what we want to do is instead have:
Wait 4,5 secs
SYSTEM---> create object ->player

Now the problem with this is that we don't know where to create the player, so we will need to create some variables to make this work. So start by making 2 global variables named playerX and playerY. Now make this event

Player on destroyed--->System-> set var playerX to player.X
set var playerY to player.Y
Wait 4.5 secs
Create object "player" at (playerX, playerY)


Let me know if this works for you :)
Sorry I couldn't give a capx I'm on my phone lol

Cheers,
Bonesey
B
12
S
2
G
1
Posts: 26
Reputation: 835

Post » Sat May 31, 2014 4:06 pm

It worked! It's now respawning. Thanks for the help Bonesey :)
B
4
Posts: 3
Reputation: 206


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests