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 / Dot Circle Tutorial

Author
Message
wpfan
18
Years of Service
User Offline
Joined: 6th Jul 2007
Location:
Posted: 9th Jul 2007 01:50
I am working on the Tutorials in the printed manual that shipped with Dark Basic Classic and am currently on Tutorial 4. Anyways though I get to the final step where it asks me to modify the program on my own with no input from the manual. The tasks are:

Change the Program to alter the size of the dot circle (no problem)
Change the program to alter the color of the dot circle (no problem)
Change the program to move the center of the dot circle as it's being drawn (this is the one that hangs me up)

For those unfamiliar with this tutorial the code for it goes something like this.



Thanks
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 9th Jul 2007 01:57 Edited at: 9th Jul 2007 01:57
The variables cx and cy hold the screen X/Y position of the centre of the circle, so alter the values stored in those within the loop.

TDK_Man

RUCCUS
21
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 9th Jul 2007 02:28 Edited at: 9th Jul 2007 02:28
Dont forget to refresh the screen inside the loop as well. You'll need to use the CLS command at the beginning of the loop, to whipe the data from the screen for the next circle draw. Otherwise you'll get a smear of circles.


Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 15th Jul 2007 19:57
This doesn't draw a circle. You've used cosine for both OX and OY, one of them needs to be sine.


I am king of the noobs!
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 15th Jul 2007 20:06 Edited at: 15th Jul 2007 22:59
Quote: "Dont forget to refresh the screen inside the loop as well. You'll need to use the CLS command at the beginning of the loop, to whipe the data from the screen for the next circle draw. Otherwise you'll get a smear of circles."

This isn't entirely true as each loop draws a single dot, clearing the screen would wipe each dot as it's drawn.

I've changed your code so that it will draw 360 dots (your program was doing this anyway), but instead of going round the circle again it now clears the screen and starts a new circle. I've left it to you to work out how to move the circle (TDK hinted at it).



I am king of the noobs!

Login to post a reply

Server time is: 2026-07-06 03:25:27
Your offset time is: 2026-07-06 03:25:27