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.

Dark GDK / DarkGDK homework.

Author
Message
izic
15
Years of Service
User Offline
Joined: 9th Sep 2009
Location:
Posted: 9th Sep 2009 19:43
I to need answer a few questions but I don't have the book Starting out with games and graphics by Tony Gaddis and I won't be able to afford it anytime now? Can anyone help me answer these questions?

1. What is the screen resolution for default DarkGDK windows?

2. What is a screen coordinate system? What is the coordinate of thepixel in the bottom right corner of a defailt DarkGDK window.

3. What is dbDot and how is it used in general? Show an example of dbDot and explain what will happen when your example is used.

4. What is dbWait and how is it used in general? Show an example of dbWait and explain what will happen when your example is used. How is dbWait different from dbWaitKey?

5. What dbLine and how is it used in general? Show an example of dbLine and explain what will happen when your example is used.

6. What is dbBox and how is it used in general? Show an example of dbBox and explain what will happen when your example is used.

7. What is dbCircle and how is it used in general? Show an example of dbCircle and explain what will happen when your example is used.

8. What is dbEllipse and how is it used in general? Show an example of dbCircle and explain what will happen when your example is used.
puppyofkosh
17
Years of Service
User Offline
Joined: 9th Jan 2007
Location:
Posted: 9th Sep 2009 22:56
I'd look in the documentation, it has a lot of these answers.
BearCDP
15
Years of Service
User Offline
Joined: 7th Sep 2009
Location: NYC
Posted: 10th Sep 2009 20:25
1. You can manually check most of these things


2. You can also check this by arbitrarily placing a dbCircle() somewhere near the origin and the dimensions you get from dbScreenWidth() and dbScreenHeight(). Place a blue one at 10,10 and a yellow one at 600,400. You'll be able to determine how the coordinate system works by observing what happens.

3. All of the Text and Basic2d commands of the DarkBasic family start with a default color of white, which you can change by calling dbInk(int red, int green, int blue);
As you have probably observed, Dark<Basic/Basic Pro/GDK> starts up with a black screen by default. Without any prior calls to dbInk(), dbDot(100,100) will make a pixel at screen coordinate 100,100 turn white.

4 - 8.
Quote: "I'd look in the documentation, it has a lot of these answers. "


You learn Dark<Whatever> best by doing. Read the help file in "C:\Program Files\The Game Creators\DarkGDK\Documentation" and you will see a lot of examples and references for all the commands. If you're confused about a particular command, then search the Newcomers DBPro Corner board, DarkBasic Professional Discussion board, and of course this one. DarkGDK's functions mirror DarkBasic Professional's commands.

Before you start making a game that uses commands that you haven't used before in DB, you should absolutely spend a very good chunk of time with a test program in which you pretty much play around with all the commands you think you might use until you feel you have a good enough grip on them to use them for your game. I still have a FoolAround project that I'm constantly opening for times when I'm using an unfamiliar command, or one that I haven't used in a while.
Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 11th Sep 2009 18:46
The first question can be answered just by starting a new project. Everything else can be answered incredibly easily by just a small amount of work. Id give you the answers but you wouldn't really be learning anything.
izic
15
Years of Service
User Offline
Joined: 9th Sep 2009
Location:
Posted: 11th Sep 2009 22:57
New question. How do I comment dbcircle?

I know how comment dbline which is "Draw line P from (400, 290) to ( 450, 290)." but I'm not sure how to comment dbcircle when I have something like "dbCircle (167,151, 50);"
izic
15
Years of Service
User Offline
Joined: 9th Sep 2009
Location:
Posted: 11th Sep 2009 23:06
How do I comment dbCircle (167,151, 50);

Would it be something like: //Draw circle from center
puppyofkosh
17
Years of Service
User Offline
Joined: 9th Jan 2007
Location:
Posted: 12th Sep 2009 00:31
You can comment however you want.
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 12th Sep 2009 03:23
The parameters of the dbCircle funcions are :

first parameter : screen X-coordinate
second parameter: screen Y-coordinate
third parameter : circle's radius

You can find out what the various function's parameters are by searching in the DarkGDK informations file.(help file)

Your comments will not affect your code or how the compiler sees it and operates on it, so it doesnt matter how you structure them, but generally its a good idea to keep them clear, concise meaningful.

If it ain't broke.... DONT FIX IT !!!

Login to post a reply

Server time is: 2024-10-01 12:33:09
Your offset time is: 2024-10-01 12:33:09