Changing Layouts Issues.

0 favourites
  • 4 posts
From the Asset Store
Simplistic hyper-casual game with nature elements. Tap to switch between the 4 elements and reach a better score.
  • 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: dropbox.com/s/knagwfwctx8f969/lavarun.capx

  • 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.

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)