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 / Menu - Start game problem

Author
Message
Shadow000
14
Years of Service
User Offline
Joined: 31st Jul 2010
Location:
Posted: 2nd Aug 2010 10:41
Okay, second thread. I have a problem. I use a basic menu for my game (for the time being). I can't make it start the game. It ends just after displaying the "Get ready to play" message. I tried goto, if scancode()>0 then goto Start *label was just above rem Start game* and finally, my current code. Nothing seems to work. Plz help Thanks!


-The only thing that doesn't require effort is nothing.
-If there's something in this world that you can't buy, that's experience.
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 2nd Aug 2010 15:17
The snippet you posted doesn't compile.

Just under the new_game label you have a repeat but no matching until command.

I remmed out the repeat, and the "Could not close nest" error was solved, and your program ran fine. (Altho I added a wait key command at the end just to be safe...)

And as for you initial problem, try adding this code after the wait 2000 bit.



To make your program wait for a keypress before continuing.

Shadow000
14
Years of Service
User Offline
Joined: 31st Jul 2010
Location:
Posted: 2nd Aug 2010 23:34
Ugh. I just added a bit of code, and now it doesn't work. Compiles just fine, but stays at the "Get ready to Play" Screen. Doesn't do anything more. Code thus far:

And I have another question, technical I believe. When I add more projects to DBpro, I mean, have more than 1 running, in tabs, if the first one is empty it displays another code's execution, regardless of which tab is selected. Also, even if one of the other tabs that have been opened have a problem, or (I think) are even partly repeated, it displays an error. If there's a repeated part, It displays an error. If you close all tabs and leave only one, still, if they have a problem, they'll pop back on. And it says there's a problem on a stupid line, i.e. 141 when your program is only about 72 lines. Help please?

-The only thing that doesn't require effort is nothing.
-If there's something in this world that you can't buy, that's experience.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 3rd Aug 2010 01:47 Edited at: 3rd Aug 2010 02:01
It's good to see you are already using functions (did you write that yourself?) but a shame to see you using goto lol.
I made a small change to your function and explained it in the code.

It wont help with your problem though, I had a look at the rest of your code but I'd have to completely rewrite it to help because the program flow is messy, I've written a structure help thread that should help you.

Shadow000
14
Years of Service
User Offline
Joined: 31st Jul 2010
Location:
Posted: 3rd Aug 2010 09:12
I know my code is messy, I've just started programming . No, I didn't write it myself but I completely understand it, and I could write a similar one . As a matter of fact, I changed a couple of things from the initial code, to make it better. Thanks!

-The only thing that doesn't require effort is nothing.
-If there's something in this world that you can't buy, that's experience.

Login to post a reply

Server time is: 2024-11-23 11:19:29
Your offset time is: 2024-11-23 11:19:29