How can I make layout items to not be created again

Get help using Construct 2

Post » Thu Oct 27, 2016 9:50 am

I'm trying to make a sidescrolling platformer and one of the last addiction was the layout switching, back and fourth.

The problem I'm encountering is, if I place enemies, items and so on and go forward, whenever I go back to the layout again, the enemies and items are created again.

How can I tackle this?
B
14
S
5
Posts: 248
Reputation: 1,705

Post » Thu Oct 27, 2016 1:39 pm

Give them the Persist behaviour or make them global objects.
B
46
S
16
G
74
Posts: 2,088
Reputation: 44,185

Post » Thu Oct 27, 2016 2:04 pm

plinkie wrote:Give them the Persist behaviour or make them global objects.


If I do that they will stay for sure, dont they? I want you to be able to grab the coins only once and if you go back, the coins are already "grabbed"
B
14
S
5
Posts: 248
Reputation: 1,705

Post » Thu Oct 27, 2016 2:09 pm

You could initially create the coins based on a global variable being 0 and if they are collected set it to 1, so when you return they won't be created.
B
46
S
16
G
74
Posts: 2,088
Reputation: 44,185

Post » Thu Oct 27, 2016 2:31 pm

plinkie wrote:You could initially create the coins based on a global variable being 0 and if they are collected set it to 1, so when you return they won't be created.


Is this the most effective way to make a sidescrolling game objects?
B
14
S
5
Posts: 248
Reputation: 1,705


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 8 guests