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 / The Number Game...which freezes

Author
Message
Yodaman Jer
User Banned
Posted: 5th Nov 2007 18:43 Edited at: 5th Nov 2007 21:55
TDK, first off I have to compliment you on the great tutorial on Variables! You made it so easy to understand them. Thanks!
Now, I took up your 'test' about making the number game, modified it to be what I wanted, and had a blast making it!
Problem is, it freezes up after the player guesses the right number.
I can't find anything that looks suspicious about the code...is it supposed to freeze and I have to figure it out? If so, no problem.
Here's the code just in case it's NOT supposed to do that...


Thanks for pointing me in the direction of the tutorials!
EDIT: Found out it was supposed to happen...lol.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 6th Nov 2007 00:14
The program was freezing because there is no SYNC call in the main loop. When you set SYNC ON you must tell the computer when to update the screen.

I also tidied up the top part of the code; you only need to set formatting once and it will apply to all further text (unless you change it again of course).
Also, RGB(0,0,0) means no reds, no greens and no blues; no nothing! which is the same as giving 0.

Font sizes in DB v1.2 are different ("bigger") so you'll have to take that into account when using old tutorials


Now I got it working it's not too bad
Now see if you can get it to work without that nasty GOTO!
That can seem quite difficult to do as a newbie but once you learn how to make your programs loop naturally everything will run much smoother and be easier on the eyes
Keep up the good work

"You must be someone's friend to make comments about them." - MySpace lied.

Login to post a reply

Server time is: 2025-05-31 21:04:11
Your offset time is: 2025-05-31 21:04:11