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 Discussion / can ne1 see ne problems with this?

Author
Message
FROGGIE!
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: in front of my computer
Posted: 10th Apr 2004 15:19
Why wont this code work? it runs and i can change the max score. but when i click on start it just exits. it doesnt even give an error message. im sure its something to do with the nesting becuase when i tried changing the disc speed it did the same thing.

my games are only as good as the people who play them...
so if my game is crap then its your f******g fault!
Don Malone
22
Years of Service
User Offline
Joined: 27th Apr 2003
Location: Birmingham, Alabama
Posted: 10th Apr 2004 18:54 Edited at: 10th Apr 2004 18:56
If it was setup as you have it here that is because there is no return from the gamestart function. Remember that Basic runs instructions one after another in the order presented and uses Gosub, goto and functions to control the program flow.

Your program should gosub GAMESTART and have a return at the end of the GAMESTART code ...OR... (this is Bad Programming practice but) Use a goto statement (so no return is expected) and at the end of the GAMESTART code use another Goto to redirect the program to the next section of code you need to run.

That is if I know what I think I know and that I read your code correctly.

[edit] just reread your code and I see that most of your code looks good at a glance but I didn't see the return from GAMESTART. Is that where your problem is coming from?

good luck.

Wasting CPU Cycles since the 286 was a hot machine.
Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 10th Apr 2004 19:24
Your problem is probably the goto. DB doesnt particularly like it, and it often gives problems like this. Try putting it in a function or even a gosub.

Its not a bug, its a feature!
Penfold
21
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: RED postbox houses of parliment
Posted: 10th Apr 2004 20:08
DB780 is right there is nowhere for the program to go after the gamestart part of the code has been activated... it won't return to the game as there is no command telling it to.

'Ooh 'eck chief'...'crumbs'

Login to post a reply

Server time is: 2025-05-23 06:00:27
Your offset time is: 2025-05-23 06:00:27