GameOver

Get help using Construct 2

Post » Wed Oct 19, 2011 8:58 pm

HI

Almost there ... for the Competition :-)

Ive made a Layout = GameOver
and here I have the score and a play again btn

this goes to my layout1
BUT HOW DO I ...

Reset the game ( can I be don a global way )


Regards
flemmig

B
23
S
12
G
10
Posts: 323
Reputation: 7,382

Post » Wed Oct 19, 2011 10:07 pm

It all depends on how you coded everything.

When you go back to a layout, the code is executed again from the "On start of layout event".

Nevertheless, if you used global variables and/or global objects, those are still in memory, and then you have to "reset" them from the gameover layout, when you click on restart.

For example, a global HiScore variable needs to be set to 0 (or else the game will start again with the current score).
Same goes for global objects, you need to set them to their original start position/content/instance variables values, etc...
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,999
Reputation: 57,793

Post » Thu Oct 20, 2011 11:41 am

Thanks !

Esaxt and done :-)

B
23
S
12
G
10
Posts: 323
Reputation: 7,382

Post » Fri Mar 02, 2012 12:56 am

How about how to reset local variables like EX: a local time variable?

I need to know dfor my game. after boss beat or dead etc.. need time to stop and reset if player chooses to rety level.Erndog2k2012-03-02 00:56:54
B
27
S
11
G
1
Posts: 246
Reputation: 5,048

Post » Fri Mar 02, 2012 1:16 am

@Erndog2k: There's an error in your term I think.
Local variables are reseted each tick.

Once again, it depends how you made your game.
But pretty much, set your timer to 0 when you take your player back to a ride in the level.
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,999
Reputation: 57,793

Post » Fri Mar 02, 2012 2:06 am

http://www.scirra.com/forum/topic49686_post312743.html#312743

Thanks for speedy reply :)

above is a link to a forum I opened better explaining I think what i'm trying to do. as well as the tut I used to do it.

srry in advanced for spelling keys are dying.

Erndog2k2012-03-02 02:11:52
B
27
S
11
G
1
Posts: 246
Reputation: 5,048

Post » Tue Jan 07, 2014 7:42 pm

Small stupid question that might add a bit of light.

I destroyed the Player object when the user is killed. Then I created a new object in an event, but it seems that the Player object is duplicated.
Tips?
B
33
S
9
G
1
Posts: 153
Reputation: 2,998


Return to How do I....?

Who is online

Users browsing this forum: chcteacher, Televangelist and 27 guests