Consistent Pick-Ups?

Get help using Construct 2

Post » Fri Mar 29, 2013 12:57 am

Example Controls - Left Click or Touch.

I am having trouble getting my pick-ups working. I want it so when you pick-up a blue carrot in level one, it will stay picked up when you return to that level. If you look at the example file, if you play the first three levels, you can return to any of the levels and the pick-ups that you already picked up earlier will return.

How would I go about keeping them "picked up"?

Thank you.
Olive2013-03-29 00:59:13
B
14
S
2
Posts: 72
Reputation: 1,224

Post » Fri Mar 29, 2013 5:48 pm

Do you have a different layout for each level? If that's the case you have to work with global variables and store the data in those variables for each level and when you than restart a level first check the global variables to see if a carrot is gone.
B
10
S
1
Posts: 26
Reputation: 1,007

Post » Tue Apr 02, 2013 7:47 pm

No worries. I have just seen the latest update (r124).

"the new Persist behavior allows you to make persistent layouts. Normally if you leave a layout then return to it, all its objects have reverted to the initial state as you designed in the editor. Sometimes this is annoying if you want, say, the player to return to a previous level but with all the enemies they killed and powerups they collected still gone. Now you can simply add the Persist behavior to objects you'd like to remember - in this case, the enemies and powerups. Then on returning to the layout, all those objects are exactly as you left them. This is great for non-linear games where you want the player to come through a previous section, but without having to re-do everything they did before."

Thank you Scirra!
B
14
S
2
Posts: 72
Reputation: 1,224


Return to How do I....?

Who is online

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