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 / DBC 2D Guess The Number Game With Grapics

Author
Message
Brazos
22
Years of Service
User Offline
Joined: 7th Apr 2003
Location:
Posted: 5th Jun 2009 10:02
I have a problem with this. That is the player can click the mouse to soon which adds another try to their score.

That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 5th Jun 2009 18:55 Edited at: 5th Jun 2009 19:01
well off the bat, ur misusing the randomize command, the randomize command randomizes the rnd() command, heres an explanation:

think of the rnd() command as an array with infinite dimmensions, each number you put in will give you a number 0-x where x is that inputted number, but the array is usually constant, so EVERY time you run the program, rnd(3) will return the same value, not very random, but randomize changes the output number based on the parameter you give it, so randomize 100 at the top of your program would change the outputs to a different value than randomize 101 would, however again those values would still be constant, so if you put randomize 100 at the top of your code then EVERY time the code is run the values would be equal, so wat you need to do is have a number after randomize that would change each run, the answer? timer() this commands calls the computer time in milliseconds, so each run the time would have changed, so the rnd() values would change

so at the top of any program using rnd() you should put:

randomize timer()

make sense?

that all I can see off the bat, ill look through the code and get back to you on the problem

problem 2:

you misspelled Arial, u put ariel at line 11

minor problem:

wenevr u create a new bitmap, that automatically becomes the current bitmap, so set current bitmap 1 isnt needed at line 15

problem 2:

why create images of try numbers? 2 problems with this, 1 - waste of memory getting images, 2 - in theory if the try exceeded the last image created then it would error out or cause other problems

There are only 10 kinds of people in the world, those who understand binary and those who dont
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 5th Jun 2009 19:03
o, read on and i saw u did use randomize timer() later, why then did you use randomize 100 and 250 above then?

also ill post a fixed version of your code later so you dont need to edit your copy

There are only 10 kinds of people in the world, those who understand binary and those who dont
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 5th Jun 2009 20:27
heres my version:



its not as good as yours, i didnt incorporate the try system or instructions, but mine is much more organized in my opinion

also im having a weird glitch with the play again option, sometimes it works, sometimes it doesnt, if you could figure out why it would help, but its no big deal

if you have any questions just ask

There are only 10 kinds of people in the world, those who understand binary and those who dont

Login to post a reply

Server time is: 2025-05-16 20:38:18
Your offset time is: 2025-05-16 20:38:18