0 Favourites

Coins that don't respawn

  • Hello!

    I'm doing a platformer. In my game, the player has a set number of lives. Each time he dies, he gets back to the beginning of the level. The collectibles (COINS) should NOT respawn (so he cannot re-take a coin he already got).

    But they should be back when he uses a continue. I'm not able to do that (the coins are set as Global, so they don't reapear between lives, but that way they don't reapear with a restart layout).

    Any ideas on how to deal with that?

    Thanks in advance!

  • You could use a global variable call it continues if continuing add to that number...

    then add condition continues greater than 0 create coins...

  • Just reading this again I am guessing you are not creating the coins at runtime...

    if that's the case, and you don't have any performance worries then don't destroy them just set them invisible and deactivate collision detection then when continuing set them visible and reactivate collisions...

    PS in most cases global objects are more hassle than they worth...

  • Thank you very much, Pixel perfick! I will use your suggestions as guideline. Another way would not to set the COINs as global, but then again I would have the problem of hiding then when already picked in that gameplay. Still learning a lot about Construct 2, thanks for your advice.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Update: It worked wonders as you suggested! Instead of destroying the object (COIN), they were turned invisible and with deactivated collision. Then back on with the continue function.

    Thanks again!

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