How do I create an object exactly where I destroyed the obj.

Get help using Construct 2

Post » Thu May 08, 2014 2:30 pm

Here is the scenario:

Bad guys chasing the good guy, bad guy catches the good guy, good guy gets destroyed. Bad guys walk away, Good guy reappears in exactly the same spot that he disappeared from, so the bad guys can start chasing good guy again. I got all the chasing stuff no problem, what I can't figure out is how to make the good guy reappear and the same spot he disappeared from?

As always thanks for any help.
B
25
S
10
G
3
Posts: 154
Reputation: 2,843

Post » Thu May 08, 2014 2:41 pm

What if they chased him only while he was visible , then make him invisible when he is caught , then visible again after a time lag ?
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 08, 2014 2:45 pm

Well one way that i can figure, is you can

1. create another object say A spawner sprite make it invisible by default

2. wait for few seconds 2 or 3 sec

3. then create the player on that spawner position

4. if player is visible then destroy spawner

I hope this helps
Every Game is a Good Game it's just few people like and few does not! Keep coding people some day you will be a "NOTCH".
B
21
S
6
G
3
Posts: 85
Reputation: 4,607

Post » Thu May 08, 2014 2:50 pm

Nope not working even when invisible the bad guys still chase him they chase him because of "Move at angle: angle(virus.X,virus.Y,GamePlayer.X,GamePlayer.Y)"
B
25
S
10
G
3
Posts: 154
Reputation: 2,843

Post » Thu May 08, 2014 3:17 pm

but couldn't you just set up a condition along the lines of

if player alive (visible ?) -- enemies move towards player
else -- enemies go about normal routine

?
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,882

Post » Thu May 08, 2014 11:26 pm

Store the player.x and the player.y somewhere before you destroy the player object. For example, in a Dictionary. Then, when you create the player again, reference the stored values. For example, Dictionary.Get ( "PlayerLastDiedAtX" ) and Dictionary.Get ( "PlayerLastDiedAtY" ).
B
6
Posts: 25
Reputation: 327

Post » Fri May 09, 2014 12:32 am

Adding the conditions on the visible/invisible example works like a charm. p0pzst, your solution sounds pretty interesting it's given me some ideas. I've said it before this is the best forum on the internet.
B
25
S
10
G
3
Posts: 154
Reputation: 2,843


Return to How do I....?

Who is online

Users browsing this forum: Kin, mickclarke, TRMG and 50 guests