Coins not appearing after re-entering the layout.

This forum is currently in read-only mode.
From the Asset Store
112 High-Quality Coins and Chest SFX specially crafted for video games
  • Hello guys I am currently working on a platformer where you can not only go forward, but you can return to levels you've already visited and picked up bonuses/coins, but when I return to another layout it resets and coins are there again. How do I do that when you picked up coins once you can't get them any more by re-entering the layout to avoid easy coin farming. Any ideas?

  • Well, a punishing way could be to have a global array that only stores if each level has been visited, then if it has it removes all bonuses.

    Otherwise, the global array object will need to store every coin for every level, then remove them as the player collects them.

    Hmm, or you can use the INI object to store this to a save file, that works too.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes, I've already tried it but the problem is that I want only coins that I've already picked up disappear, but other coins to stay where they were after re-entering level.

  • Yeah, you'll need to store in an INI file which coins have been collected then as well as give each coin a variable like "COINNUM"

    so:

    on player touch coin, coin destroy + save INI value "HAVE" to group "Level1" and item "Coin" & Coin.value('COINNUM')

    <then>

    On start of layout -> for each coin object -> If INI value in item "Coin" & Coin.value('COINNUM') and group "Level1" = "HAVE" then coin destroy

    <then check to make sure INI file worked>

    *in INI file.ini*

    [level1]

    Coin1=HAVE

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