Layers, help needed ...

0 favourites
  • 5 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hi,

    first I may say that I'm an absolutely newbie in the game design/programing field.

    I have started using Construct2 some weeks ago (Ilove it) and I try to create a platform game (something similar to Manic Miner).

    After some weeks creating layouts and solving troubles by myself (I like to fight by myself usually :P) I have found one that I can't solve without some experienced help :(

    I tried to simplify as musch as possible the situation in a capx file but I try to elaborate some more here:

    I want to make a PAUSE GAME event. Althought maybe it's not the most elegant way I have managed to get it working nicely.

    But after some days I decided to add a GAME OVER screen and then the troubles came.

    After you get killed 3 times a GAME OVER screen pops up. Then when you get playing again and presses P to pause the game the layer showing the PAUSE instructions appears behind the main layer even it beeing really in the most top layer :(

    Any ideas on how to solve that problem will be more than welcome.

    Many thanks in advance,

    Ignasi aka Topeich.

    CAPX file here: http://dl.dropbox.com/s/758noco1xsw8pui/LAYER_TROUBLE.capx <img src="smileys/smiley1.gif" border="0" align="middle">

  • Simple solution: Set your 'overlay' object to non-global. It is set as global now and appears in every layout, thus making pausing possible in every layout.

    Perhaps better solution (if you intend to use pausing on other layouts) would be to check if active layout is 'game over' at the pausing event. You can do that by checking current layout name (see: scirra.com/manual/126/system-expressions )

    Or perhaps if you have plans for maaany layouts, create global variable 'LayoutAllowsPausing' that is set to 0 or 1 at the start of each layout depending whether that particular layout allows you to use the pause feature. When running the pause event you could check if this variable is 0 or 1 and deny/allow pausing based on that.

  • On the condition "on P pressed" add an action "Move to layer 4" for every object you need on top.

    I don't know why restaring the main layout happens this (Honestly, I didn't take a look to the rest of your event sheets) but with those actions it works.

  • Simple solution: Set your 'overlay' object to non-global. It is set as global now and appears in every layout, thus making pausing possible in every layout.

    That's the idea to use it as global to be able to re-use in every layout of the game.

    Perhaps better solution (if you intend to use pausing on other layouts) would be to check if active layout is 'game over' at the pausing event. You can do that by checking current layout name (see: scirra.com/manual/126/system-expressions )

    Or perhaps if you have plans for maaany layouts, create global variable 'LayoutAllowsPausing' that is set to 0 or 1 at the start of each layout depending whether that particular layout allows you to use the pause feature. When running the pause event you could check if this variable is 0 or 1 and deny/allow pausing based on that.

    That's a nice idea, I'll have a look at it as seems a safer way to do it.

    But do you think this will help in the layer depth isue?

    Many thanks for the answer.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • On the condition "on P pressed" add an action "Move to layer 4" for every object you need on top.

    I don't know why restaring the main layout happens this (Honestly, I didn't take a look to the rest of your event sheets) but with those actions it works.

    Yehaa, simple and working solution!

    Many thanks Knifegrinder.

    Cheers.

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