Changing Layouts Issues.

Get help using Construct 2

Post » Thu Nov 01, 2012 10:23 pm

Hey guys
       I recently came across this issue that im having in construct 2, basically when my character gets hit by an enemy its plays his death animation, and switches to the temporary death layout, and then when i click on that it brings me to the mainscreen which is okay, but when I click on the mainscreen it brings me to the ingame layout but all the trees disappear and it doesnt start at the original speed that it should start with. Whats the problem here fellas? I know im missing something basic :P

Cheers!
capx: https://www.dropbox.com/s/knagwfwctx8f969/lavarun.capx
B
7
S
2
G
3
Posts: 15
Reputation: 2,319

Post » Fri Nov 02, 2012 1:00 am

Switching between layouts would reset the layouts. It's like closing a layout and opening another. So the easy way out is to use layers instead of layout. The best method is to find a way to store all the states of the objects in your main game layout into a global instance or variable then loading the states when you switch back to the layout.
B
7
Posts: 38
Reputation: 683

Post » Fri Nov 02, 2012 1:22 am

System -> On Start of layout : System -> Set speed to 2

That will reset the speed of the game.

I am pretty sure there are other parameters for the tiled backgrounds and the acceleration of the sprite16 that should be reset at the start of the layout as well, but still working on it.
B
22
S
9
G
3
Posts: 202
Reputation: 3,645

Post » Fri Nov 02, 2012 1:45 am

Even though you go from one layout to the next and then back to the game layout you are still increasing global and instance variables every tick or every x number of seconds. You have to set rules that reset the variables (speed, acceleration, etc.) back to their original settings.
B
22
S
9
G
3
Posts: 202
Reputation: 3,645


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot], jul, nicklowkcmagic, Yahoo [Bot] and 16 guests