Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Returning Back To Start?

Author
Message
Dritt
18
Years of Service
User Offline
Joined: 10th Jan 2006
Location:
Posted: 22nd Apr 2007 14:21
Hi!

I have this event going once trough, and after it finishes i want the player to start all over again.

I have tried gosub and goto but i get error saying label does not exists.

In blitz3d as an example, all i have to do is to put (.game_start) at the top before any codes, and the buttom (goto .game_start.)
So it dousent jump to any label at the beginning of the event, only after its finished.

Iv looked in the help files on 1 example, but it dousent help me much.

I appreciate all help.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 22nd Apr 2007 15:44
What you do is put your main menu in a procedure and have the game playing section in the main loop.

At the start of the program, do your setup and Gosub Main_Menu. Trap the program so it only Returns from the Main Menu procedure when the player selects Play Game.

At the end of the game, simply Gosub Main_Menu again and repeat!

The following is an example of pseudo (not real) code:



Tutorial 2 here might be useful too...

http://forum.thegamecreators.com/?m=forum_view&t=99497&b=10

TDK_Man

Dritt
18
Years of Service
User Offline
Joined: 10th Jan 2006
Location:
Posted: 22nd Apr 2007 16:08
Thank you very much again TDK.

It works. And what i did forget earlier was to put in this (. I wasent sure on where or how the code should be placed.

But now its pretty simple.

I placed this at the top (game_start. At the buttom (gosub game_start).

I dident even need return!

Login to post a reply

Server time is: 2024-09-25 21:28:58
Your offset time is: 2024-09-25 21:28:58