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.

DarkBASIC Professional Discussion / Restarting my game

Author
Message
MightyRy
15
Years of Service
User Offline
Joined: 19th Oct 2010
Location:
Posted: 24th Dec 2010 14:35 Edited at: 24th Dec 2010 14:38
I want to restart my game but having a few problems.

Here is a few snippets. My Main DO-LOOP, win and defeat function.



Here is my win and defeat functions.

Both functions work they appear when player has won or died.

But they wont go back to the start of the game, after i have pressed any button.







If anyone has an idea whats wrong would be greatful.

Note
im using a dbo for my level which is the static object 0
dn5
15
Years of Service
User Offline
Joined: 23rd Dec 2010
Location:
Posted: 24th Dec 2010 15:29
I would use GoTo command, but I don't know right sintax in DBPRO, as I am mostly Delphi programmer.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 24th Dec 2010 16:57
EXIT won't work like that - the EXIT statement has to be coded directly within the loop it is to break out of.

In addition, don't use GOSUB like that - GOSUB is meant to be used when you want to jump somewhere, then return back later. You don't need a GOTO either.

Just put another loop around your main loop (replace the label and the GOSUB with a DO ... LOOP), and then after you've fixed your EXIT's it should work.

Login to post a reply

Server time is: 2026-07-21 20:35:27
Your offset time is: 2026-07-21 20:35:27