Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,619 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Is they a way I can restart the game after the game ended? #358813
02/13/11 15:49
02/13/11 15:49
Joined: Oct 2010
Posts: 11
Netherlands Antilles
A
aaronde Offline OP
Newbie
aaronde  Offline OP
Newbie
A

Joined: Oct 2010
Posts: 11
Netherlands Antilles
I would like to ask if there is a command that will restart the game. Let the game start completely from the beginning.

I though that maybe this can be achieved with a while loop in the main function. But this will cause the entity's to be loaded a second time. Will the engine destroy the old instance or do I need to do it manually?

Re: Is they a way I can restart the game after the game ended? [Re: aaronde] #358815
02/13/11 16:04
02/13/11 16:04
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
I guess that you mean restarting a level not the entire game.
Look into the manual for level_load.
level_load destroys all entities within the current level, while loading the given level in the brackets.

Re: Is they a way I can restart the game after the game ended? [Re: Pappenheimer] #358873
02/13/11 22:04
02/13/11 22:04
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
There are no common patterns that deal with "restarting" a game, because a game is so much more than a level that can be re-loaded with level_load. If that is your case you have to reset e.g. all your variables to the state they are at the beginning. Also, if your game is embedded into a menu structure, take this also into account.

Don't laugh at me smile but making a level work is imho a piece of cake compared to making a full retail-like game of it and especially re-starting the game as a whole and/or in parts is an issue which can be quite a difficult task, sometimes.

So, please describe your problems and issues so that we can just point you into the right directions.

Last edited by HeelX; 02/13/11 22:05.
Re: Is they a way I can restart the game after the game ended? [Re: HeelX] #358875
02/13/11 22:10
02/13/11 22:10
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
the best solution I've seen is to save the game after everything is loaded then if you need to restart load that save file

Re: Is they a way I can restart the game after the game ended? [Re: MrGuest] #359370
02/17/11 01:40
02/17/11 01:40
Joined: Oct 2010
Posts: 11
Netherlands Antilles
A
aaronde Offline OP
Newbie
aaronde  Offline OP
Newbie
A

Joined: Oct 2010
Posts: 11
Netherlands Antilles
mrguest. You are a genius. Didn't think of that. That is the perfect solution. Thanks. Its a small one level game for a school project and I need a way to restart the game after the player has lost.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1