How do I reset the game when the player lose?

Just started using Construct 2? Post your questions here

Post » Mon Sep 21, 2015 6:48 am

How can i to reset the game when the player lose?.
I tried the sentence restart layout, and start again, but not from beginning, and i need that the game is restart tottally

How can i do that?

Thanks
B
4
Posts: 50
Reputation: 290

Post » Mon Sep 21, 2015 4:37 pm

@crynof Try this,

On the last even before you trigger "restart layout" reset all your variables.

Im guessing that the user is acquiring points or something that is not resetting? you need to tell the system to reset those before you restart the game.


hope this helps
Image
B
26
S
4
G
3
Posts: 147
Reputation: 4,875

Post » Tue Sep 22, 2015 1:37 am

i reset the variables and now works.
Other question.
How can i do to after x second where the player not collision a object, is to be destroyed?
Thanks!
B
4
Posts: 50
Reputation: 290

Post » Tue Sep 22, 2015 12:20 pm

crynof wrote:How can i do to after x second where the player not collision a object, is to be destroyed?


This question is very unclear, but it seems like you'd want to add either the timer-behaviour or a regular countdown timer,
many examples on how to use and/or create this can be found throughout the forum..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Sep 22, 2015 12:38 pm

Sorry for my English,

The question are after x seconds the player does not collide with a box, is destroyed.

I tried with system condition "every seconds", but i have a problem with the sentence "when a player on collision with a object", because this is only primary event and not a subevent, and i need to put like subevent to after invert . This way when the player after x second does not collide, is destroyed.

Exist other way??


Thanks
B
4
Posts: 50
Reputation: 290

Post » Tue Sep 22, 2015 9:37 pm

You can invert the "player is overlapping" condition or just use else like below..
Together with the timer behaviour it would be something like this:

player is overlapping box
> stop timer "KillTime"
else
trigger once
>start timer "KillTime" for x seconds

on timer "KillTime"
> game over
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest