Coins not appearing after re-entering the layout.

For questions about using Classic.

Post » Thu Oct 10, 2013 7:52 pm

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?MastaZavr2013-10-11 17:53:28
B
11
S
3
G
6
Posts: 193
Reputation: 4,234

Post » Fri Oct 11, 2013 1:01 am

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.
"Construct 4 lets YOU make advanced games! (they wont run anywhere)" Construct Classic - Examples Kit Dropbox is a pile of trash and if you need my old files PM me! :)
B
125
S
42
G
17
Posts: 2,228
Reputation: 19,918

Post » Fri Oct 11, 2013 5:55 pm

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.
B
11
S
3
G
6
Posts: 193
Reputation: 4,234

Post » Fri Oct 11, 2013 11:04 pm

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

"Construct 4 lets YOU make advanced games! (they wont run anywhere)" Construct Classic - Examples Kit Dropbox is a pile of trash and if you need my old files PM me! :)
B
125
S
42
G
17
Posts: 2,228
Reputation: 19,918


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests