How do I set a layout strart?

Get help using Construct 2

Post » Tue Mar 14, 2017 2:50 pm

i got a menu layout with a button (start) to go the game layout. but i realized that every second i spend at the menu, the game layout is running in memory, so when i click start the game has already started and i start whit some damage on my character and the enemies are already moving and things like that
how do i set the game layout to start running when im on in or when i click start?
B
5
Posts: 31
Reputation: 291

Post » Tue Mar 14, 2017 3:12 pm

You can prolong this by not including your main game event sheet in the start event sheet. However, you have to keep in mind the event sheet will have ran through several iterations (60 times a second) before you even see it upon a regular load. So make sure you add sufficient delay between your "on start of layout" setup stuff and your running game events.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
66
S
17
G
8
Posts: 637
Reputation: 9,370

Post » Tue Mar 14, 2017 3:58 pm

When you go from the menu event sheet to the first game layout reset global variables first.

On button clicked: Reset global variables.. Go to layout1

That way your game starts fresh with variables set where they should start.
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,780

Post » Tue Mar 14, 2017 4:12 pm

lamar wrote:When you go from the menu event sheet to the first game layout reset global variables first.

On button clicked: Reset global variables.. Go to layout1

That way your game starts fresh with variables set where they should start.

cant do that. my character selection is working with global variables... i would lose the character i selected...
B
5
Posts: 31
Reputation: 291

Post » Tue Mar 14, 2017 4:41 pm

Then reset the variables like time and health only at the start of the game layout.

That only runs once and won't effect player choice variable.
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,780

Post » Tue Mar 14, 2017 5:21 pm

lamar wrote:Then reset the variables like time and health only at the start of the game layout.

That only runs once and won't effect player choice variable.

could be a solution but not completly, enemies are way far from their spawn point by the time i click start and play the game.
also the player could spend minutes on the menu cause there's like 70 characters to select...
B
5
Posts: 31
Reputation: 291

Post » Tue Mar 14, 2017 5:23 pm

chrisinfinger wrote:You can prolong this by not including your main game event sheet in the start event sheet. However, you have to keep in mind the event sheet will have ran through several iterations (60 times a second) before you even see it upon a regular load. So make sure you add sufficient delay between your "on start of layout" setup stuff and your running game events.

how can i not include that?
also the player could spend minutes on the menu cause there's like 70 characters to select so putting a delay wouldnt fix this...
B
5
Posts: 31
Reputation: 291

Post » Tue Mar 14, 2017 6:04 pm

JohnnyBeGood wrote:
lamar wrote:Then reset the variables like time and health only at the start of the game layout.

That only runs once and won't effect player choice variable.

could be a solution but not completly, enemies are way far from their spawn point by the time i click start and play the game.
also the player could spend minutes on the menu cause there's like 70 characters to select...


70 characters to select?

Good grief no wonder you are having problems.
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,780

Post » Tue Mar 14, 2017 6:29 pm

lamar wrote:
JohnnyBeGood wrote:
lamar wrote:Then reset the variables like time and health only at the start of the game layout.

That only runs once and won't effect player choice variable.

could be a solution but not completly, enemies are way far from their spawn point by the time i click start and play the game.
also the player could spend minutes on the menu cause there's like 70 characters to select...


70 characters to select?

Good grief no wonder you are having problems.

64 to be exact :roll:
any solutions?
B
5
Posts: 31
Reputation: 291

Post » Thu Mar 16, 2017 1:29 am

1. Put all your code/events that are running too early in their own group set deactivated by default. Activate the group inside the button that launches game when character selection is finished.

2. Second option is set your events like move/spawn, etc to condition out true a global like layoutstarted=1 and set that global as mentioned above (I do this in my space shooter in my sig).

3. Lastly you might have to reorganize your events so the character selection stuff does not need the main sheet to include it. It simply calls start layout main when player finished selection and all selections are store globally.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
66
S
17
G
8
Posts: 637
Reputation: 9,370


Return to How do I....?

Who is online

Users browsing this forum: leena222, mindragon73, tatogame and 22 guests