How do I reset a game ?

Just started using Construct 2? Post your questions here

Post » Mon Mar 24, 2014 1:13 am

Hey, not to but in on the tread but did you guys ever figure this thing out?
B
7
S
1
Posts: 19
Reputation: 495

Post » Mon Mar 24, 2014 7:04 am

plikrus wrote:Hey, not to but in on the tread but did you guys ever figure this thing out?


Well, as for me, I think reloading the page is a pretty decent way of doing it. The game will restart with all variables restored to default, but it will of course restart to the splash screen, so it might not be the best way for everyone.

I'm sure there is a better (and probably more complicated) solution, but I haven't really spent much time exploring other options yet.
B
14
S
3
Posts: 123
Reputation: 1,571

Post » Mon Mar 24, 2014 7:08 am

Actually you "just" need to find all the things that could be created/changed during the game and reset them to default.
Commands like "reset all global variables" will help you. Or you just reload the layout.
B
14
S
3
G
1
Posts: 255
Reputation: 2,027

Post » Mon Mar 24, 2014 8:03 am

It sounds easy enough, but I ran into some trouble when I wanted certain object to have the Persist behaviour, so as to for example stay dead if the player have killed them when restarting layout. So in order to reset these when the player wants to restart the game from the beginning, the easiest way for me was to use "reload page" action.
B
14
S
3
Posts: 123
Reputation: 1,571

Post » Mon Mar 24, 2014 11:27 am

Actually I think you have to use "reset global variables"
B
8
S
4
Posts: 131
Reputation: 1,205

Post » Mon Mar 24, 2014 11:33 am

I would Just do if invisable and visable way

example: if player hit enemy set Sprite 2 visable/Invisable
system on start of layout set sprite 2 visable/invisable

Hope i helped :P
[img]imageshack.com/a/img19/5018/sqio.png[/img]
Banned User
B
5
S
1
G
1
Posts: 88
Reputation: 723

Post » Mon Mar 24, 2014 12:22 pm

Actually I am looking for a solution to this (see attached .capx)

click red square to go to game layout

left or right mouse to move, hit yellow bar and return to start layout

Problem is I have used reset/destroy/reload but you will notice that "score" will not show on second enter to game layout.

I have a solution in mind and the is to drop the start/menu layout and just reload but I would rather not if???

Thanks for any help
Ed
You do not have the required permissions to view the files attached to this post.
B
7
S
1
Posts: 19
Reputation: 495

Post » Mon Mar 24, 2014 3:41 pm

c13303 wrote:Actually I think you have to use "reset global variables"


Are you saying objects with Persist behaviour will be restored to default with this action?
B
14
S
3
Posts: 123
Reputation: 1,571

Post » Wed Mar 26, 2014 1:30 am

Well I have no idea if this will help anyone else but I've found my issue:

Global yes/no --- NO
You do not have the required permissions to view the files attached to this post.
B
7
S
1
Posts: 19
Reputation: 495

Post » Wed Mar 26, 2014 8:28 am

@Oceldot : yes !

And as shows plikrus picture, it seems that a persist object is a "global" object
B
8
S
4
Posts: 131
Reputation: 1,205

PreviousNext

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests