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

0 favourites
  • 7 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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 ?

  • 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

  • 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)"

  • 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


  • 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" ).

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)