restart layout, doesn't really restart.

Bugs will be moved here once resolved.

Post » Tue Jan 22, 2013 2:17 am

In my game (like bubble shooter), i added a button to restart the current level then with "restart layout" action. But this don't restart the layout, infact all the balls are destroyed, so them are counted!!

Maybe this is not a bug, but i think that a restart MUST really restart.


Sorry my bad english, please help me!
B
17
S
5
G
3
Posts: 76
Reputation: 2,948

Post » Tue Jan 22, 2013 2:32 am

Please see how to report bugs.

Please post your capx and if you're unsure this is a bug, you might want to rather post in the "how do I" forums to request help with your project.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Tue Jan 22, 2013 2:37 am

I do not think it is necessary to post my capx. I want know why on restart leyout, all sprite are destroyed
B
17
S
5
G
3
Posts: 76
Reputation: 2,948

Post » Tue Jan 22, 2013 4:52 pm

All non-global objects are destroyed when changing level or restarting a level. This is by design, since restarting a level ought to revert the level to its initial state. Closing since this does not sound like it's a bug. Provide a .capx if you wish for us to investigate further.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Tue Jan 22, 2013 5:40 pm

I can post my .capx, but is for an android game, so I do not want to be made public!! Can I send it to one for fix the restart?
B
17
S
5
G
3
Posts: 76
Reputation: 2,948

Post » Tue Jan 22, 2013 6:07 pm

The problem is: when the balls are destroyed, they add money, mana and kill to me (thehe are global varibles), so on restart of layout the give me as mana, noney and kill as balls I have. For resolve this, I thought to deactive this group on layout restarted, but then does not come back active! why??
B
17
S
5
G
3
Posts: 76
Reputation: 2,948

Post » Tue Jan 22, 2013 6:10 pm

Add another global variable called inPlay or something that makes sense to you, update the logic of your scoring, etc... to only function when inPlay is set to true. Then update your button logic so that when they hit the button, before it calls restart layout, it sets inPlay to False. Then have an event on layout start that sets the variable to true so that you can continue with your score, etc...

Hope that helps for your situation.
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418

Post » Tue Jan 22, 2013 6:21 pm

Ok, it work ;) thanks for help.
B
17
S
5
G
3
Posts: 76
Reputation: 2,948

Post » Tue Jan 22, 2013 6:23 pm

No problem, glad it worked for you.
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest