How do I destroy coins forever?

Get help using Construct 2

Post » Fri Dec 19, 2014 10:54 pm

Hello,
Im making a platform game. There are coins in the layout one, and the player can take them. The player can also go to another layour and then return to the first layout. When this happens, the coins that were already taken, appear again in the layout 1. Is there any way to make the coins a "global object"? or something?
Thank you!
B
7
S
1
Posts: 28
Reputation: 652

Post » Fri Dec 19, 2014 11:02 pm

Have you tried adding the Persist behavior to the coin?
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,986

Post » Fri Dec 19, 2014 11:48 pm

Thank you @Burvey, but I realized that it works just setting the "global" property to yes on the sprite... =)!
B
7
S
1
Posts: 28
Reputation: 652

Post » Sat Dec 20, 2014 2:03 am

To be honest it's probably a good idea to remove the global property and just use the persist behavior in this situation. At least that is what I would do. There are many ways to do things though and you can do it however you like. :) Good luck with your game.
B
61
S
20
G
56
Posts: 1,077
Reputation: 35,986

Post » Sat Dec 20, 2014 1:01 pm

persist good behavior in this situation like Burvey said
B
249
S
39
G
15
Posts: 1,952
Reputation: 40,579

Post » Sat Dec 20, 2014 1:16 pm

Definitely persist. :)
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
16
S
4
G
1
Posts: 416
Reputation: 2,313

Post » Sat Dec 20, 2014 1:20 pm

Ok, persist behavior! =) thank you so much to all of you! :)
B
7
S
1
Posts: 28
Reputation: 652

Post » Sat Dec 20, 2014 4:48 pm

To be exact, a persist object will keep its proprieties and existance while still existing in one layout (which is what you want according to the first post), and can be resetted, however global objects exists in the entire game when first met, which is useful for some objects but they cannot simply be resseted and can cause issues sometimes (since they are always there until destroyed.), so that is not as good as persist in your case, hope that helps understanding!
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Mon Dec 22, 2014 12:32 pm

Thank you so much @Aphrodite you helped me too much! :)
B
7
S
1
Posts: 28
Reputation: 652


Return to How do I....?

Who is online

Users browsing this forum: marcinkowski, Shenkai the ssj and 26 guests