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 / Using Trial DBP Need Help with Randomize

Author
Message
Merrie
18
Years of Service
User Offline
Joined: 18th Jan 2006
Location: PA
Posted: 19th Jan 2006 04:44
Hello everyone nice to be here. I am working through the wonderful tutorial by Joseph Thomson and Im stuck on the following exercise:
'Make a program that keeps drawing random size circles at random positions on the screen in random colors.'

So far I have the code listed below which gives me nice random colors, however, the circle is in the lower right hand corner. (Is my cursor position in the wrong place in the code?)
And Im not exactly sure how to set up the code so it will produce random size and position on the screen.

I appreciate assistance with a sample. Thanks!
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 19th Jan 2006 10:42
People that are still in the "Newbie Slap" as we call it can't use the source box for their code. Always use code snips (even after you're out of the Newbie Slap).

[ code ]
Your code here.
[ /code ]

Just remove the spaces between the brackets and we see this:


The syntax for the circle command is "circle x coordinate, y coordinate, radius". If it's always in the lower right it's doing "circle 640,480,radius". Put the same command to pick a random number there "circle rnd(640),rnd(480),radius" or use variables.




Merrie
18
Years of Service
User Offline
Joined: 18th Jan 2006
Location: PA
Posted: 19th Jan 2006 16:15
Thank you for the sample and the clue in to the code snippet tags. And I reviewed your Pro-Noob Anti-Boob Justice League, very cool, and a extra Thank You for being Noob friendly.

Login to post a reply

Server time is: 2024-09-24 13:27:52
Your offset time is: 2024-09-24 13:27:52